jQuery: No cueing on animation - not working on slideDown or Fades
I'm working on a project with several anima开发者_高级运维tions; fades, slides, and regular pixelanimation.
My client hates that jQuery "remembers" how many times you have activated a animation, and therefore continues animating (cueing) when you leave (unHover ..if that's even a word :-P).
I've found a solution, that only works on the pixelanimations, and not on the slideDowns, and fades. It is to set stop() before animation. "stop().animation".
Is there a solution that works everywhere?
Thank you!
.stop()
will work, just pass it arguments for those other cases (or in all cases), like this:
.stop(true, true).animate(/* options */);
The second true
tells it to jump to the end of the animation, which fixes issues like a slide remembering a half-way-down height and such.
精彩评论