- deferred – any object with
- e.g. a jQuery selection, a jQuery.Deferred, or another deferred jQuery chain.
- callback –
- a method that is called once just before continuing the invocation chain.
- All current iteration counts/events (from inner-most to outer-most loop) are passed as arguments.
Tip: You can also wait for the current end of the elements' effect queues via .join().
Examples with waiting for a deferred object
There is a animation cycle rotating three images. Once you move the mouse cursor over it, it pauses until the mouse is moved away.A little helper function checks whether the mouse is over the image. If that's the case a deferred jQuery object waiting for the mouseleave event is returned.
The running loop can be written in a single jQuery line.⇒