This demonstrates how to animate multiple attributes of an HTMLElement using the YUI Animation Utility. Click the button to begin the demo.
The YUI Animation Utility allows you to animate multiple attributes with a single animation instance.
For this example, we will animate the height and width of the
<div> element named
Add a little style so that we can see the animation in action:
demo element and a button to run the animation:
Now we create an instance of
YAHOO.util.Anim, passing it the element we wish to animate, and the style attribute(s) to be animated:
The final step is to call the
animate method on our instance to start the animation. The button will be the trigger that begins the animation sequence:
This is an example of animating multiple style attributes of an HTMLElement.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.