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.

Custom <strong>Animation</strong>s<br />

Time for action – creating an animated content viewer<br />

We'll start again by adding the underlying markup and styling.<br />

1. The underlying markup for the content viewer should be as follows:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

&laquo;<br />

Image<br />

1<br />

Image 2<br />

Image 3<br />

Image 4<br />

Image 5<br />

<br />

&raquo;<br />

<br />

<br />

2. Save the file as animate-position.html.<br />

3. Next we should create the base CSS. By that I mean that we should add the CSS<br />

which is essential for the content-viewer to function as intended, as opposed to<br />

styling that gives the widget a theme or skin. It's good practice to separate out<br />

the styling in this way when creating plugins so that the widget is compatible with<br />

<strong>jQuery</strong> UI's Themeroller theming mechanism.<br />

4. In a new file in your text editor add the following code:<br />

#slider { width:500px; position:relative; }<br />

#viewer {<br />

width:400px; height:300px; margin:auto; position:relative;<br />

overflow:hidden;<br />

}<br />

#slider ul {<br />

[ 104 ]

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

Saved successfully!

Ooh no, something went wrong!