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.

7<br />

Full Page <strong>Animation</strong>s<br />

So far the examples that we've looked at are animations that have formed a<br />

single part <strong>of</strong> the user interface <strong>of</strong> the page, or formed part <strong>of</strong> a specific widget.<br />

In this chapter, we'll look at animations that take up the whole page, such as<br />

background-image animations, or "feature" animations where the thing<br />

being animated is the main focus <strong>of</strong> the page.<br />

In this chapter, we'll cover the following subjects:<br />

Animating page scroll<br />

Animating background-position to create a parallax effect<br />

Combining page scroll with page navigation<br />

Creating stop-motion animation<br />

All <strong>of</strong> the examples that we'll look at in this chapter will be based on the animate() method<br />

that was introduced earlier in the book. As we've already learnt how the method is used, we<br />

can jump straight into the action and start on the examples.<br />

Animated page scroll<br />

We can animate the scroll <strong>of</strong> the entire page very easily using a combination <strong>of</strong> some built-in<br />

<strong>jQuery</strong> functionality and some plain vanilla JavaScript. Long blog pages are <strong>of</strong>ten split into<br />

smaller, more readable sections with sub-headings, and a secondary navigation structure,<br />

separate from the main site navigation, which links to the different sections. Optionally,<br />

there may also be back to top links that take the reader back up to the top <strong>of</strong> the page.

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

Saved successfully!

Ooh no, something went wrong!