YUI 3.x Home -

YUI Library Examples: Animation Utility: Animating Along a Curved Path

Note: This is YUI 3.x. Looking for YUI 2.x?

Animation Utility: Animating Along a Curved Path

This demonstrates how to animate the position of an element along a curve.

Click anywhere to move the element to your click position.

Setting up the HTML

First we add some HTML to animate.

Creating the Anim Instance

Now we create an instance of Y.Anim, passing it a configuration object that includes the node we wish to animate.

Changing Attributes

A click handler will set the to value before run is called.

Running the Animation

Finally we add an event handler to run the animation.

Full Script Source

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings