Jump to content

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

Moving timeline to the end, then reversing

Go to solution Solved by Shaun Gorneau,

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

Hi all!


This is more of a general question, but I'll explain my use-case.


I have a component that has a timeline attached to it. This component is visible to start, but the timeline itself visually removes it from the page (a dismissible alert). In a particular case, I need to utilize both the reverse, then the forward action immediately. So, I am looking for a way to start the timeline at the end, reverse it, then play it. I've looked into both `time()` and `progress()` but when I run those, they seem to be accelerating "to" that point, instead of just plain setting the time, like `TweenMax.set()` would. Perhaps I've been approaching this wrong, but if anyone has an idea how to set that timeline to be at the end by default, I'd really appreciate it. Thanks!

Link to comment
Share on other sites

  • Solution

.progress(1) should go right to the very end of the timeline with no amount of tweening. That is unless progress itself is being tweened; e.g.

vat tl = new TimelineMax();
TweenMax.to( tl, 1, {progress:1} );

Do you have a codepen illustrating your issue?

  • Like 4
Link to comment
Share on other sites

I'm not sure I completely understand the question, but you should be able to use:


As Shaun mentioned, a CodePen would be most helpful.


Happy tweening.


  • Like 3
Link to comment
Share on other sites

I think I had some conflicting resize listeners that was firing off the progress timer that was getting in the way. Making this a more vanilla test worked as it should. Thanks both for helping!

  • Like 2
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.