I have an animation script that should change the div animation based on mouse events (e.g. mousemove, click, etc.). One of the problems is that the animation has to run every time you click the div button.
In Chrome, the only browser available for testing * (see note below) does not work:
when an element is clicked once, it works as expected, but if it is double-clicked (two events are fired), the following will happen:
- in the item inspector, the class shows the change
- however, the animation continues as if the class never changed, and the second event never started.
NOTE. Unfortunately, I only have a chrome book, and I can not perform testing in another browser, since I only have chrome. I know that I am cheap. I apologize.
ADDITIONAL NOTE: native javascript is preferred, but jQuery solutions are not bad.
MORE NOTES: for clarity, since I think I confused many people when the object clicked a second time, the animation should start, not continue.
JS FIDDLE (on request): this fiddle
javascript css css3 animation css-animations
user3186555
source share