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.

Extended <strong>Animation</strong>s with <strong>jQuery</strong> UI<br />

5. When the is clicked, an outline is transferred from the Firefox icon to the<br />

App folder icon to direct the visitor:<br />

The transfer element is resized as it moves from the starting element across to the target<br />

element. The animation is approximately 50 % complete in the previous screenshot.<br />

What just happened?<br />

In the underlying HTML we have a container which is given the background image<br />

<strong>of</strong> the application install dialog box. Within this we have a which is given the Firefox<br />

icon background, and a second which is given the App folder icon. Both inner <br />

elements are given id attributes for styling purposes and for easy selection with <strong>jQuery</strong>.<br />

In the script we add a click-handler to the which applies the effect every time<br />

the is clicked. The handler function calls the transfer effect on the #firefox<br />

element, which sets the icon as the starting element.<br />

[ 154 ]

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

Saved successfully!

Ooh no, something went wrong!