Jump to content
GreenSock

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

Return animation back to start values

Recommended Posts

Hi I'm very new to gsap and I was trying to make a hover animation for my buttons. But I would like the button to return to his start position. I tried to use clearProps, but that doesn't seem to do the trick. Hope someone can help!

See the Pen abOygZB by Samlinck (@Samlinck) on CodePen

Link to post
Share on other sites

Hey samlinck and welcome to the GreenSock forums! Thanks for the minimal demo, it's very clear.

 

The reason why clearProps is not working is because you're adding it to the timeline. Since the timeline is paused, that set call is not reached until later (when it's unpaused). To get it working, use just gsap.set() instead :) Alternatively, you could not clear anything but instead use .pause(0)

  • Thanks 1
Link to post
Share on other sites

Okay that was easy 😄. Thanks!

 

Link to post
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.

×