I think the issue is relative with queue in Jquery.
We can use clearQueue() to clear queue to stop any animate, however the clear queue cannot stop the call back function
consider this
$("#sth").animate( { width:'100%' }, 2000, function() {
$("#sth").css("width","0%");
});
and
$("#sth").clearQueue().css("width","0%");
is able to stop the animate and push back the width. However, after 2000 miliseconds, it will also turn to 100% width, because of the complete call back function. the function will invoke after 2000 miliseconds no matter whether the queue exists.
From jQuery documentation:
and
Try use .stop() instead .clearQueue().