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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4<br />

Sliding <strong>Animation</strong>s<br />

Another type <strong>of</strong> effect that is built into <strong>jQuery</strong> is the slide effect. Elements can<br />

be made to slide vertically so that they appear to open or close depending on<br />

their current state. There are three methods related to sliding that are exposed<br />

by <strong>jQuery</strong>:<br />

slideDown()<br />

slideUp()<br />

slideToggle()<br />

How each <strong>of</strong> these methods works will be explored thoroughly over the course<br />

<strong>of</strong> this chapter.<br />

Some <strong>of</strong> the skills we'll learn include:<br />

Showing hidden elements with slideDown()<br />

Hiding visible elements with slideUp()<br />

How an element's CSS styling can influence sliding animations<br />

How we can save code with slideToggle()<br />

How to add easing effects to sliding animations<br />

How to deal with a common usability issue with sliding animations triggered by<br />

hover events<br />

You should note that the sliding methods all work with the display style property <strong>of</strong> the<br />

selected element(s), and are used to either show or hide the element in question by sliding<br />

it open or closed.

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

Saved successfully!

Ooh no, something went wrong!