jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of jQuery 1.4 Animation Techniques - Index of

02.06.2013 Views

6 Extended Animations with jQuery UI jQuery UI is the official user interface library for jQuery and adds a suite of interactive widgets such as tabs and accordions, a series of interaction helpers such as drag and drop, and a comprehensive set of effects that extend those provided natively by jQuery. Over the course of this chapter, we'll be looking at the additional effects added by jQuery UI. Topics we'll cover include: Obtaining and setting up jQuery UI The new effects added by jQuery UI Using the effect() method Extending the show(), hide(), and toggle() methods Using easing with jQuery UI Animating an element's color Animated class transitions jQuery UI adds several new animation methods, as well as modifying several jQuery methods. The methods we'll be looking at in this chapter are: animate() addClass() effect() hide() switchClass() show() toggle()

Extended Animations with jQuery UI Obtaining and setting up jQuery UI jQuery UI is very easy to obtain and set up. There is an online tool that will build a custom download package for us containing just the parts of jQuery UI that we'll need. Due to the modular nature of jQuery UI it makes sense to minimize the code payload we use on any given web project and so the ability to include only the modules of code we intend to use helps us to minimize any impact on the visitor our code may have. The jQuery UI download builder can be found at http://jqueryui.com/download. The page is split into two sections with the components of the library listed at the left and the theme details at the right. The download builder has a certain amount of intelligence, and will ensure that any dependencies are automatically selected when we choose the components we require. [ 138 ]

6<br />

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

<strong>jQuery</strong> UI is the <strong>of</strong>ficial user interface library for <strong>jQuery</strong> and adds a suite <strong>of</strong><br />

interactive widgets such as tabs and accordions, a series <strong>of</strong> interaction helpers<br />

such as drag and drop, and a comprehensive set <strong>of</strong> effects that extend those<br />

provided natively by <strong>jQuery</strong>.<br />

Over the course <strong>of</strong> this chapter, we'll be looking at the additional effects added by <strong>jQuery</strong> UI.<br />

Topics we'll cover include:<br />

Obtaining and setting up <strong>jQuery</strong> UI<br />

The new effects added by <strong>jQuery</strong> UI<br />

Using the effect() method<br />

Extending the show(), hide(), and toggle() methods<br />

Using easing with <strong>jQuery</strong> UI<br />

Animating an element's color<br />

Animated class transitions<br />

<strong>jQuery</strong> UI adds several new animation methods, as well as modifying several <strong>jQuery</strong><br />

methods. The methods we'll be looking at in this chapter are:<br />

animate()<br />

addClass()<br />

effect()<br />

hide()<br />

switchClass()<br />

show()<br />

toggle()

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

Saved successfully!

Ooh no, something went wrong!