Hello,
I was taking a look at this tutorial here to prevent animation buildups:
http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup
My situation: I am doing a double animation like this below, and would like the prevent the animation build up. Since I have 2 animations going, it seems it ignores the .stop(). What can be done to prevent this? I have tried .stop() on both .animate and if I do that it stops animating...
$(document).ready(function() {
$('#element').hover(function() {
$(this).stop()
.animate(
{ left: 200 }, {
duration: 'slow',
})
.animate(
{ top: 200 }, {
duration: 'slow',
});
} , function() {
$(this).stop()
.animate(
{ left: 0 }, {
duration: 'slow',
})
.animate(
{ top: 0 }, {
duration: 'slow',
});
});
});
Any help will be greatly aprecaited!!