.stop()
method is evident when we need to animate an element onmouseenter
and mouseleave
:Hover me
We can create a nice fade effect without the common problem of multiple queued animations by adding
.stop(true, true)
to the chain:$('#hoverme-stop-2').hover(function() { $(this).find('img').stop(true, true).fadeOut(); }, function() { $(this).find('img').stop(true, true).fadeIn(); });
Animations may be stopped globally by setting the property$.fx.off
totrue
. When this is done, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.
No comments:
Post a Comment