Jump to content


Nested Timelines causing incorrect transforms

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 am trying to build a timeline that is composed of nested timelines. I am finding that the when I nest the timeline, the yoyo playback(and even the plain repeat) ends up playing the incorrect values and the css matrix gets set incorrectly.


It works fine if I add the Tween like this:

  tl.add ( TweenLite.fromTo( ... ))


but if I create a new timeline and add that, I get the error.

 tl2 = new TimelineLite();

 tl2.add ( TweenLite.fromTo( ... ));

 tl.add( tl2 )



I have an example here: http://jsfiddle.net/7h5ED/2/


I left it in the broken state, but if you change the showBroken variable to false, you'll see the correct

behavior. It should have a sequence like: slide in from top, zoom out, slide in from right. When this yoyos in the broken state, the reverse zoom goes offscreen instead of to the middle of the screen.


Any help would be appreciated! Thanks!






Link to comment
Share on other sites

Interesting - this looks like a regression introduced in 1.9.2. We're working on identifying exactly what it is and how to fix it. Thanks for putting together the jsfiddle - very helpful. Stand by...

Link to comment
Share on other sites



Jack this solved the issue:


    var v = $("div.v"),
    masterTL = new TimelineMax({repeat:-1, yoyo:true}),
    tl1 = new TimelineLite(),
    tl2 = new TimelineLite();


    .to(v, .75, {top:-34})
    .to(v, .75, {scale:3, opacity:0});
    .to(v, .0001, {left:300, opacity:1, scale:1})
    .to(v, .75, {left:3, ease:'swing'});

Creating two different timelines and adding them to a parent one. Although the problem remained with the fromTo method and the solution was to add a minimal duration to the tween in order to get the element to the right, at normal scale and opacity.


Updated fiddle:





Link to comment
Share on other sites

I believe I tracked it down and resolved it (see attached preview of 1.10.2). Would you mind giving it a shot and letting us know if it fixes things for you? According to my tests, it's workin' great. 


  • Like 1
Link to comment
Share on other sites

That seems to be working great for me as well! The to() with zero duration seems to working now as well. Thanks for the quick turn around!



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