Jump to content
GreenSock

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

global timeline ticker?

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,

 

I have many TimelineMax animations either running at the same time, or not running at all; is it possible to create an event that will be called everytime any timeline is ticking, and get the timeline that is ticking in that event? 

 

an alternative would be to set a simple javascript setTimeout call but only if I can tell if there are currently no running animations; is it possible to check if ANY timeline is currently running?

 

Thanks,

 

Elior

Link to comment
Share on other sites

That functionality doesn't exist in the API (that I am aware of) but there are 2 ways worth exploring:

 

1 give every timeline an onUpdate callback that notifies some object that the timeline is currently active

 

2 put all your timelines in an array and constantly loop through the array and check the isActive() status of each: http://greensock.com/docs/#/HTML5/GSAP/TimelineLite/isActive/ IF you find that no animations are active you could then stop doing this check and restart it the next time you play another animation. 

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