20100810

jquery stop

-- map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_} unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"The usefulness of the .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 to true. 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