Jump to content
GreenSock

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

Different duration for reverse animation

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Howdy internet,

I was wondering if there was a way to set a different duration for the .play() and .reverse() animations. I tried to use a function instead of a value, but according to my console, it's only called once, so that value is stored in memory...

 

Thanks!

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Yeah you can do change the timeScale() when you play() and reverse() take a look here:

 

http://codepen.io/GreenSock/pen/twclk

 

tween = TweenLite.to(logo, 3, {left:"632px", ease:Linear.easeNone});


  playBtn.onclick = function() {
    tween.play().timeScale(1);
 }


 reverseBtn.onclick = function() {
 tween.reverse().timeScale(6);
 }

Same applies to TimelineLite or TimelineMax animations.

  • Like 3
Link to comment
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.
×