Alex Rivera | Logout

Stopping specific jQuery animations

Asked 2011-02-09T19:57:11.240
11

I have multiple animations on a single object, and I need to stop a specific animation rather than all of them. It doesn't look like the .stop() method can do this.

For instance, when animating opacity and width simultaneously, I may need to cancel the opacity animation while still completing the width animation. It would seem that this is not possible, but I am hoping that someone knows a trick or an API call that I'm missing.

Note: I'm not talking about queued animations, I'm looking to animate multiple attributes at the same time with the ability to stop some of those attribute animations after they have already started

Edit
Report

1 Answer

1

UPDATE 2013

As of jQuery 1.7 you can use .animate() with a named queue, and use .stop(queuename) to stop only those animations in the queue.

http://api.jquery.com/animate/
http://api.jquery.com/stop/

answered 2013-07-10T15:15:41.903

Your Answer