
marco.fugaro
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
ScrollTrigger Demos
Downloads
Posts posted by marco.fugaro
-
-
I have a gsap timeline, which I trigger on hover and play it reversed on mouseleave.
However I need to change the easing when I play the timeline reversed. Is there a way I can do this without duplicating the whole timeline again?
Here is a stripped down example, full example is in the codepen.
const ease = 'power2.out'
const tl = gsap.timeline({ paused: true })
// tweens here...
card.addEventListener('mouseenter', (e) => {
tl.play()
})card.addEventListener('mouseleave', (e) => {
// need to somehow change the easing to 'power2.in' here
tl.reverse()
})See the Pen abpZWOJ?editors=0010 by marco_fugaro (@marco_fugaro) on CodePen
Change easing when reversing tween or timeline
in GSAP
Posted
Hey @akapowl, thanks for the solution, didn't know about that method.
Worked out leaving `ease: 'none'` in the timeline and using the eases in `tweenFromTo` calls.