02.06.2013 Views

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3<br />

Managing <strong>Animation</strong>s<br />

Like most <strong>of</strong> the methods that <strong>jQuery</strong> makes available to us, the effect,<br />

or animation, methods can be chained together in sequence, like this:<br />

<strong>jQuery</strong>(elements).fadeIn().slideDown()<br />

When several animation methods, such as fadeIn(), and so on, are chained<br />

together and called on the same element or collection <strong>of</strong> elements, they are<br />

placed into a queue to be executed one after the other in series rather than<br />

all executing simultaneously in parallel. The standard animation queue created<br />

for an animated element is called fx, although custom queues can easily<br />

be created.<br />

<strong>jQuery</strong> gives us several methods that make working with and manipulating an element's fx<br />

queue extremely easy. These methods include:<br />

clearQueue()<br />

delay()<br />

dequeue()<br />

queue()<br />

stop()<br />

The techniques that we'll learn in this chapter include:<br />

Viewing the items in an element's queue<br />

Counting the items in an element's queue<br />

Preventing queued effects from executing<br />

Delaying the start <strong>of</strong> the next effect in the queue

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!