javascript - How do I stop an effect in jQuery -
i have page uses
$(id).show("highlight", {}, 2000);
to highlight element when start ajax request, might fail want use like
$(id).show("highlight", {color: "#ff0000"}, 2000);
in error handler. problem if first highlight haven't finished, second placed in queue , wont run until first ready. hence question: can somehow stop first effect?
from jquery docs:
http://docs.jquery.com/effects/stop
stop currently-running animation on matched elements....
when
.stop()
called on element, currently-running animation (if any) stopped. if, instance, element being hidden.slideup()
when.stop()
called, element still displayed, fraction of previous height. callback functions not called.if more 1 animation method called on same element, later animations placed in effects queue element. these animations not begin until first 1 completes. when
.stop()
called, next animation in queue begins immediately. ifclearqueue
parameter provided value oftrue
, rest of animations in queue removed , never run.if
jumptoend
argument provided value of true, current animation stops, element given target values each css property. in our above.slideup()
example, element hidden. callback function called, if provided...
Comments
Post a Comment