Jump to content


Nested Timeline Help

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 know this is a rookie question but does someone know where to find information or knows how to setup up a basic nested TimelineMax? Any help would be appreciated. Thanks.

Link to comment
Share on other sites

no problem, you just use the add() method.



var main, child1, child2;

//create nested timeline
child1 = new TimelineMax();
child1.to("#box1", 1, {rotation:360})
.to("#box1", 1, {scale:2, top:200})

main = new TimelineMax({repeat:2, repeatDelay:0.5, yoyo:true});
main.to("#box0", 1, {top:100})
     //add nested timeline
    .to("#box0", 1, {left:300})



Check out this codepen example:

See the Pen 3eba61b98a43971cd08a63d12e002eb3 by GreenSock (@GreenSock) on CodePen


hit the "run" button to replay

  • Like 1
Link to comment
Share on other sites

Thanks. I tried this and it worked beautifully.

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.