Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery bounce moving out of place?

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

like image 649
Claire Avatar asked Dec 25 '12 02:12

Claire


1 Answers

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.

like image 129
Sean Johnson Avatar answered Oct 19 '22 04:10

Sean Johnson