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.

Download from Wow! eBook <br />

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

For reference, the second transition effect runs like this, with strips <strong>of</strong> the old image sliding<br />

away to reveal the new image:<br />

In the previous screenshot, we can see the effects <strong>of</strong> the second transition type, with the old<br />

image being stripped away to reveal the new image.<br />

Pop quiz – creating a plugin<br />

1. What is the difference between a plugin method and a function?<br />

a. There is no difference, conceptually and in practice they are the same<br />

b. Methods are able to accept arguments, functions are not<br />

c. Methods execute faster<br />

d. Methods are attached to the fn object and are used like existing <strong>jQuery</strong><br />

methods, while functions are attached directly to the <strong>jQuery</strong> object and<br />

called like any normal function<br />

2. What must each new method return?<br />

a. A string containing the id attribute <strong>of</strong> the selected element<br />

b. An array containing the id attributes <strong>of</strong> selected elements<br />

c. The this object, which points to the currently selected element<br />

d. Nothing should be returned<br />

[ 134 ]

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

Saved successfully!

Ooh no, something went wrong!