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.

Other Popular <strong>Animation</strong>s<br />

We also change the styling <strong>of</strong> the images themselves, setting them to block-level elements<br />

and floating them to the left so that they stack up horizontally in a long line without<br />

wrapping onto two lines as this would destroy the functionality <strong>of</strong> the scroller. It is the<br />

combination <strong>of</strong> floating the images, and setting the width <strong>of</strong> the container to accommodate<br />

them all that allows them to stack up as horizontally as required. We'll add a message that<br />

tells the visitor how to use the scroller so we also include some styling for this as well.<br />

The following screenshot shows how the page will appear with scripting disabled:<br />

In the previous image we can see that the images are all visible. It's not pretty, but it's highly<br />

accessible and doesn't hide the content when scripting is disabled on the client.<br />

Time for action – prepping the page for sliding functionality<br />

When scripting is enabled we can enhance the page to add the additional elements that the<br />

proximity slider requires. Add the following code to the empty function at the bottom <strong>of</strong> the<br />

HTML page:<br />

var prox = $("#proximity"),<br />

scroller = $("", {<br />

id: "scroller"<br />

[ 210 ]

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

Saved successfully!

Ooh no, something went wrong!