Stopping an animation

The stop() method can be used to stop an effect that is currently running on the selected element. In its simplest form, we may call the method without supplying any additional arguments, but if necessary we can supply up to two Boolean arguments. The method takes the following format:

jQuery(elements).stop([clear queue], [jump to end]);

The first argument clears the element's queue and the second forces the final state of the effect to be applied.

The stop() method behaves differently depending on whether there are any additional effects in the fx queue.

When the method is called and there are no functions in the queue, any effects that are currently running on the selected element(s) will simply stop and the element will remain ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.