It goes a little something like this:
$("example").hover(function(){
("example").stop().show(/*More Code*/, callback());
}, function(){
("example").stop().hide(/*More Code*/, callback());
}
)
So if the mouse were to leave the area before the first animation completed it would stop all animations, and skipping over the callbacks. Is there a way to use stop() and still execute the callback functions?
Use a
setTimeout
that is timed to fire at the end of the animation instead of a callback.Another option would be to use
.stop(true,true)
instead of just.stop()
.This clears the queue, sends the animation to the end, and fires the callback.