Jump to content
GreenSock

erikb

'fast forwarding' a tween to the end

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

How do I 'fast forward' a tweenlite instance to the end, ensuring that all of its 'onComplete' events fire right away (not on the next RAF)?

 

Much thanks for suggestions.

Link to comment
Share on other sites

It should be as simple as setting the time (like the virtual playhead) to the end:

tween.time( tween.duration() );

Or if you've got a TweenMax with repeats, it's better to do this just so that it goes to the very end of the entire sequence:

tween.totalTime( tween.totalDuration() );

(that's fine to do for any tween or timeline actually, not just TweenMax instances)

  • Like 1
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.
×