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 />

Note that when we use the stop() method with the image, it is to prevent a build-up <strong>of</strong><br />

effects if the mouse pointer is repeatedly moved on and <strong>of</strong>f one <strong>of</strong> the links. The second<br />

function is really the reverse <strong>of</strong> the first function, which simply resizes the element back to<br />

its original position and size.<br />

The transfer effect<br />

The transfer effect simply transfers the outline <strong>of</strong> one element to another element. Like<br />

the size effect that we looked at a moment ago, the transfer effect will not work if it is<br />

not configured.<br />

Configuration options<br />

The transfer effect has only two configuration options, although only one is mandatory.<br />

These options are listed in the following table:<br />

Option Default Usage<br />

className none The value <strong>of</strong> this option, if set, is added to the transfer<br />

element when the effect runs<br />

to none A <strong>jQuery</strong> selector that specifies the target element that the<br />

transfer element is sent to<br />

Time for action – transferring the outline <strong>of</strong> one element<br />

to another<br />

In this example we'll recreate a popular application installation dialog from OSX, and use<br />

the transfer effect to help show visitors where to drag the icon (the icon won't actually be<br />

draggable, all we're doing is looking at the transfer effect).<br />

1. Add the following elements to the <strong>of</strong> the template file to create the install<br />

dialog:<br />

<br />

<br />

<br />

<br />

To install the application, drag its icon over to the apps<br />

folder icon.<br />

Show me<br />

[ 152 ]

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

Saved successfully!

Ooh no, something went wrong!