Jump to content

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

animation on hover issues

Go to solution Solved by PointC,

Recommended Posts

Created a load of hover points in this section that I want to switch out the text on hover with an animation, this works however when you hover between them quickly it seems to break how do stop the overlapping of signpost text and hover text? 


Thanks in advance


See the Pen QWdjLKg by darren-ignition (@darren-ignition) on CodePen

Link to comment
Share on other sites

  • 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

@PointC thanks for the information and approach, really helpful for what I am trying achieve

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