Jump to content


Tweenlite ignoring timeline placement

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

Hi guys,


I have a weird issue that has popped up. I'm obviously missing something glaringly obvious but its stumped me.


I have created a simple accordion menu and created 2 tweens on a timeline:


    tl = new TimelineLite();
    tl.to(currOpenSub, 1, {maxHeight:0});    
    tl.to(subMenu, 1, {maxHeight:600}, 0);

..but despite me marking the second tween to start at 0 it waits until the first tween is complete before firing. I've never come across this before with Tweenlite/Tweenmax so what am I missing here?


Thanks for any advice and help guys :).

See the Pen LRkKwE by anon (@anon) on CodePen

Link to comment
Share on other sites

Thanks for the demo. 


If you open dev tools you will see that both animations are starting at exactly the same time.

See this video: http://greensock.com/forums-support-files/issue3.mp4


I think the problem is you are tweening maxHeight to and from a somewhat arbitrary value of 600.

If your menu is only 200px tall and you tween from maxHeight 600 to 0, there are 400px worth of tweening that you will never see.

  • Like 2
Link to comment
Share on other sites

Hi Carl, really sorry for the late reply. I took onboard what you said, went off and sort of lost myself down the rabbit hole of this site I'm building. Apologies.


Totally understand what you advised and kick myself for not realising it heh. I've worked around it using a trick that Jonathan (I think) posted which is:


   tl.set(subMenu, {height:"auto"});
   tl.from(subMenu, 0.3, {height:0}, 0);

Works great and no issues. Thanks for your time in making the video to clarify the issue :).

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