Jump to content
Search Community

check if ANY timeline is being played

kalreg test
Moderator Tag

Go to solution Solved by kalreg,

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 wonder if i can check for any currently active timelines. Here is why:

 

I have many timelines, with many calls to different functions and all they refer to different DOM objects. Now i want to prevent playing new animations (or queue it) if any other animation is currently being played. Since i havent found anything useful in documentation (except exportRoot but that doesnt suits my need) i want to know if i can check if any timeline of any DOM is currently being played.  

I think about something like this:

if ( TweenMax.isActive() ) { 
 // add new animation to queue
} else {
 // call new animation
}

Is that somehow possible?

Kalreg

Link to comment
Share on other sites

  • Solution

Actually after more research

mainTimeline = exportRoot({ onComplete: callback })

 works quite fine for my needs as well as queue engine and event listener (end on main timeline). It needs some modifications but it is a good start. Hope that helps anybody.

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