سؤال

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top