D.Cus Posted March 24, 2021 Share Posted March 24, 2021 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 More sharing options...
Solution PointC Posted March 24, 2021 Solution Share Posted March 24, 2021 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. 3 Link to comment Share on other sites More sharing options...
D.Cus Posted March 25, 2021 Author Share Posted March 25, 2021 @PointC thanks for the information and approach, really helpful for what I am trying achieve 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now