Jump to content
Search Community

Fade out all elements of a timeline then pause

Jan 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



i wounder how to fade all elements in a timeline. I can't introduce a new extra container - which would be easy to fad - cause of several zIndexes used for the elements.


Can someone give me a hint?



Link to comment
Share on other sites

Your best bet is to add all those elements to an array (manually) and use that array as the target for your tween.


Timelines aren't directly aware of which items are the targets of their nested tweens.

Keep in mind that timelines also have nested timelines which have their own tweens with their own targets. 


You could use getChildren() http://api.greensock.com/js/com/greensock/TimelineLite.html#getChildren()


To find all the tweens/timelines inside a timeline and then loop through all those objects and look for the nested tweens and then manually push those targets into an array, but that would be quite a bit of work and you would have to recursively loop through nested timelines and possibly loop through all the tween targets that are also arrays of targets too. 


If it sounds complicated, that's because it is ;)


I don't know how your items are structured in the DOM, but there might be a way to use jQuery to select those elements for you.

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