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

2. Which method is extended to produce color animations?<br />

Summary<br />

a. The effect() method<br />

b. The show() method<br />

c. The animate() method<br />

d. The switchClass() method<br />

In this chapter we looked at the complete range <strong>of</strong> new effects which are added by the<br />

<strong>jQuery</strong> UI library. We looked at how they can be used with the effect() method, or the<br />

show(), hide(), and toggle() methods when necessary. We saw the configuration<br />

arguments that each effect takes, and their default values when used out <strong>of</strong> the box.<br />

We also covered how <strong>jQuery</strong> UI extends the animation(), addClass(), and<br />

removeClass() methods, and the switchClass() method that it adds in order<br />

to add the ability to animate between colors and classes.<br />

The key points to take from this chapter include:<br />

<strong>jQuery</strong> UI together with <strong>jQuery</strong> can be downloaded using the <strong>jQuery</strong> UI download<br />

builder, which builds a custom package, complete with a theme if required for you<br />

to download.<br />

<strong>jQuery</strong> UI adds a total <strong>of</strong> 14 new predefined effects to our animation toolkit.<br />

The effects are easy to use but highly configurable.<br />

The effect() method is the basic means <strong>of</strong> specifying an effect, its configuration<br />

options, a duration, and a callback function.<br />

Some <strong>of</strong> the effects work much better with the show(), hide(), or toggle()<br />

methods and are equally as easy to use with this aspect <strong>of</strong> the API.<br />

The easing functions are built directly into <strong>jQuery</strong> UI and can be used by specifying<br />

them as values for the easing configuration option.<br />

<strong>jQuery</strong> UI also gives us the ability to transition an element's color or class name by<br />

extending some <strong>of</strong> <strong>jQuery</strong>'s methods and adding the new switchClass() method.<br />

In the next chapter, we'll switch back to <strong>jQuery</strong> and look at full page animations including<br />

how to animate the page's background image, animating page scroll, and feature animations<br />

that are the main focus <strong>of</strong> the page.<br />

[ 178 ]

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

Saved successfully!

Ooh no, something went wrong!