Jump to content
Search Community

Compressing Time in a Timeline

rconnard test
Moderator Tag

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

Oh great gurus with green socks!

 

I made my first HTML banner with GreenSock two days ago. It was very easy and fun, thanks to your hard work!

 

All of my animations are in one timeline using TimelineMax. 

 

My boss asked if I could 'speed everything up a little'. While I can edit the individual values, is there a way to 'fast forward' a timeline?

 

Thanks,

Ross

  • Like 2
Link to comment
Share on other sites

Yep, Oliver is right. The timeScale() method makes it super easy. Also, here's a lesser-known tip: you can actually set the duration on a timeline and it'll automatically adjust the timeScale() accordingly. For example, let's say your timeline is 17.4 seconds but you need it to be 15 seconds long. Instead of doing the math to figure out what that timeScale() should be, you could just do:

tl.duration(15); //adjust the time scale so that the timeline takes 15 seconds to complete

Another tip while I'm here...

 

If you're building out your banner and you're at the final stages, like maybe you've got 13 seconds already built out of a 15 second animation, but you don't want to keep watching the first 12 seconds over and over when you preview - you can just toss this line in during production:

tl.play(12); //jumps 12-seconds into the timeline

Then just edit that number as you go, and remove the line completely when you're done with production. It makes things so much easier :)

 

Happy tweening!

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