I have a button that will fade a div upon hover.
If I hover in a button then hover out and repeat that procedure multiple times in quick succession then hover out, the div will go on animating when it should have stopped.
Please refer to the following snippet.
http://jsfiddle.net/arvinboggs/uenEQ/9/
Is there a way to correct this behavior?
Is there a way stop the animation on the final hover out?
Cut and paste from a previous answer of mine to a similar question:
I actually create a ‘state’ variable to ensure only 1 action can fire at any time.
What I do is
Effectively, you can only fire the animation event is state == 0 and then there’s no overlapping.
So to answer your question, when you bind() the hover, it needs to check whether it’s allowed to fire the animation or not based on the state setting.