I am trying to use animation using jquery. When i mouseover the element, it increases the height and when mouseout, returns to original height.
The Problem is when i mouseover from one element to another element, the previous element’s animation is still performing. how to stop the animation of the previous element?
Fiddle code:
Use
.stop(): http://api.jquery.com/stopNotice you can chain the event binding functions instead of selecting
.div_1twice in a row.Here is a demo: http://jsfiddle.net/EVZVQ/1/
Source: http://api.jquery.com/stop
Update
You can stop all the divs at once like this (but I’m not sure this is the effect you’re looking for):
Here is a demo: http://jsfiddle.net/EVZVQ/2/