Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Can't restore box size when animate

Recommended Posts



Please scroll down and then up, in CodePen Pin.


When I start scrolling down, animation works perfectly. If I scroll up, animation works reverse but the box does not keep original size and position. How can I fix that?





See the Pen MdMwwq by deryck_oesp (@deryck_oesp) on CodePen

Link to comment
Share on other sites

You have a conflict between two tweens. The second scale tween is starting before the first finishes so you can't get all the way back to the original value because of the overwrite. The easiest solution is to remove the position parameter from the last tween or make it 1.5 so it starts after the first scale finishes.


See the Pen EzBjWq by PointC (@PointC) on CodePen


Happy tweening.

  • Like 4
Link to comment
Share on other sites

Thanks @PointC.


Works perfectly! I did not notice that. I'm a newbie in tweening :)


Have a great day!

  • Like 1
Link to comment
Share on other sites

No worries — happy to help. Let us know if you have additional GSAP questions or problems.


Happy tweening and welcome aboard.



  • Like 1
Link to comment
Share on other sites

Thanks. GSAP is awesome!!!!!



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