12

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

Claire
  • 209
  • 3
  • 8

1 Answers1

8

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.

Sean Johnson
  • 5,567
  • 2
  • 17
  • 22