mouse enter / mouse leave animation #1145
Unanswered
bouteillerAlan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'trying to trigger a svg animation when the user hovers a link. So in my head I got pretty much this plan: I add an event observer on the link and on
mouseenterI create the animation and loop it, onmouseleaveI wait to the loop to end (like that the animation is finished beautifully) and next remove the animation.The code is the following:
So firstly, reading my code I fell this is not the way to do this. I can confirm that feeling because the animation behavior is "ok" but not perfect:
onLooppause[${index}]stuff is not clean at allBut if I remove the animation that is place on the
onLoopthe svg is not displayed due to another animation when the site is loading:What's the animjs way of doing that kind of animation?
-> add an animation on
mouseenter-> remove it completely when
mouseleaveand the actual loop is finished, and conserving the0 1state that allow the svg to be drawnBeta Was this translation helpful? Give feedback.
All reactions