Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Jorge28cr

TimelineMax: Is any way to update or change the ease when the animation is reversed?

Go to solution Solved by Jorge28cr,

Recommended Posts

Hi Guys, 

I need to change the ease on a timeline on reverse, for example: 

 

var _easeElastic = Elastic.easeOut.config(1, 0.4);
var _easePower2 = Power2.easeOut;

 

function showNuts(){
    _tl2
    .to('#nuts',0,{opacity:1})
    .to('#nuts', 0.4, {opacity:1, top:18, scale:1, ease: _easeElastic})
    .to('#copyNuts', 0.4, {top:87, left:45, scale:1.5, ease: _easeElastic}, '-=0.4')
    .to('.copyNutsFill', 0.3, {fill: "rgb(232,230,1)"}, '-=0.3')
    .to('#copyJerky', 0.4, {top:85, left:21, ease: _easeElastic}, '-=0.4')
    .to('#copySeeds', 0.4, {top:85, left:22, ease: _easeElastic, onComplete:function(){
        TweenLite.delayedCall(2, function(){
           _tl2.updateTo({ease:_easePower2});
           _tl2.reverse()
        });
    }}, '-=0.4')
}

 

I know that updateTo is not part of the TimelimeMax, but that is to explain what I need when the timeline is reversed.

 

Link to post
Share on other sites

HI and welcome to the GreenSock forums,

 

It really helps if you can provide a very simple demo as explained here: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

What you're asking is a bit tricky so it would help to have some more information.

 

How is the timeline reversed? Does it happen automatically after it is done playing through or can it happen at any time when a user can do something like click a button to make it reverse?

  • Like 2
Link to post
Share on other sites

HI Jorge28cr :)

 

We've had a few posts about this topic. Here are a couple that should help.

 

https://greensock.com/forums/topic/9229-how-to-apply-different-easing-of-animation-normal-and-reverse/

https://greensock.com/forums/topic/8040-change-easing-for-timeline-reverse/

https://greensock.com/forums/topic/11702-reverse-elastic-ease-in-no-ease-reverse/

 

There's a lot of good information in those threads and they describe a few ways to do this. As Carl mentioned, this is a bit tricky though and I'd probably recommend creating two timelines for the most control. 

 

Happy tweening.

:)

  • Like 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×