Check out this Codepen link which has a button I want to integrate into my website: https://codepen.io/nikolett_codes/pen/BMmOxO
Here is the HTML code:
<div class="phone cta">Call us</div>
<div class="phone number">(453) 416-4742</div>
However, there seems to be an issue: https://i.sstatic.net/SKn2N.gif
The problem arises when hovering over the .cta element at its new position (NP) after moving the cursor from its original position (OP). The animation does not interrupt as expected. Strangely, if you hover over the OP while the .cta div is at NP (essentially hovering over the .number div), it interrupts and reverts back to the original position. What would be the best approach to tackle this challenge?
One solution could involve triggering a transition when hovering over the .number, but due to z-index constraints, the animation might not initiate. Another method might be to determine the .number position and attach an event listener to that area. Would that be the most effective way to address this issue?