Reputation: 209
I'm trying to use the jQuery UI bounce effect on a button positioned with css "left" on mouseover. It seems to work, however if you mouse over back and forth over it a few times it moves out of place and sticks to the left. I'm not really sure why it's doing this. Here's my code: http://jsbin.com/afoyiz/1/edit
Upvotes: 12
Views: 458
Reputation: 5607
Fixed it:
http://jsbin.com/afoyiz/12/edit
This makes sure to only select the button (and animate it) if it isn't already animating - the previous code had a chance of double animating the button bouncing if you timed your mouse movements correctly.
Upvotes: 8