Jump to content


killTweensOf + fromTo issue

Recommended Posts

Hi all,


I've got an issue with using a killTweensOf following by a fromTo method.

Here is a codepen for explaining the issue 

The expected behavior here would be that the blue square fades from 0 to 1 each times I hover it.

If I hover the blue square multiple times very quickly the animations plays as expected but at the end of the animation the opacity reverts to 0.

If I don't use killTweensOfthe issue doesn't occure. 



See the Pen eYddYzQ by manuelodelain-the-lessful (@manuelodelain-the-lessful) on CodePen

Link to comment
Share on other sites

Hey Manu. You're making one of the most common GSAP mistakes. What you should instead do in situations like this is create the animation beforehand and use control methods to manipulate it inside of your event listeners.

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