I'm working on a project with several animations; 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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.