Jump to content


on click problems view transition

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 im having an issue when i click for the first time in the button to animate the div this one jump and then start the transition with normality, where is the problem ? here i left a pen, thank you !

See the Pen vpGvZb by JulesthanP (@JulesthanP) on CodePen

Link to comment
Share on other sites

Not sure what happened to demo I posted, it was working while I was editing it. Anyway, you can do it like this and save yourself from all the calculation.


See the Pen JMKPgd?editors=0110 by Sahil89 (@Sahil89) on CodePen


  • Like 5
Link to comment
Share on other sites

Great solution, Sahil!


@vulture, Welcome to the forums.


I had a bit of trouble assessing what you wanted your code to do. I'm sure you're just starting out with GSAP, no worries, there is a lot to explore.


One of the great strengths of GSAP is its ability to group animations together in sequences called Timelines. Animations in a timeline do not have to follow a strict one-after-the-other pattern. They can overlap and even have gaps. You can even nest timelines in timelines.


As you can see by Sahil's demo the 2 animations follow perfectly in sequence. No need for onComplete callbacks and setTimeout().

Also, if you want to set properties instantly (no animation) you can use the set() method. https://greensock.com/docs/TweenLite/static.set()

I'm sure you will love timeline's once you get comfortable with them.


Take a look at these articles / videos





Good luck on your project.

Happy Tweening!

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