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.

Time for action – creating the stage and adding the styling<br />

[ 187 ]<br />

Chapter 7<br />

The underlying page requires just five elements (for this simple example), which sit in the<br />

<strong>of</strong> the page.<br />

1. Add the elements in the following structure to a fresh copy <strong>of</strong> the template file:<br />

<br />

<br />

<br />

<br />

2. This page can be saved as parallax.html. Don't forget to link to the cssHooks<br />

file that we'll be using in this example after the link to <strong>jQuery</strong> at the bottom <strong>of</strong> the<br />

:<br />

<br />

<br />

<br />

3. The CSS in this example is equally as simple as the underlying HTML. Add the<br />

following code to a new file in your text editor:<br />

div { width:100%; height:1000px; position:absolute; left:0; top:0;<br />

}<br />

#background { background:url(../img/background.png) repeat-x 0 0;<br />

}<br />

#midground { background:url(../img/midground.png) repeat-x 0 0; }<br />

#foreground { background:url(../img/foreground.png) repeat-x 0 0;<br />

}<br />

#stage { background:url(../img/ground.png) repeat-x 0 100%; }

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

Saved successfully!

Ooh no, something went wrong!