Jump to content
Search Community

animation on hover issues

D.Cus test
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

  • Solution

The problem here is you have multiple timelines fighting for control of the same element. This thread has a similar topic and may be helpful to read and check out the answer demo.

 

If you want to take a slightly different approach, you could change the text in your placeholder element rather than adding the extra divs. The text plugin is great for that sort of thing. I created a function for the mouseenter and mouseleave events. In the enter function I check if we have an active hover timeline. If there is one, the progress is set back to 0 so there are no weird overlaps. Then just a quick timeline creation and play. In the leave function it's just a simple reverse of the timeline.

 

See the Pen 6ef58b252a1b135fb2cad222407f79f5 by PointC (@PointC) on CodePen

 

Of course if you want to use jQuery, add the divs, etc. that is totally fine too. I just thought I'd throw out another idea. Hopefully it helps.

 

Happy tweening.

:)

  • Like 3
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.
×
×
  • Create New...