diff -r 000000000000 -r 40c8f766c9b8 src/cm/media/js/lib/yui/yui_3.0.0b1/examples/dd/anim-drop.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/media/js/lib/yui/yui_3.0.0b1/examples/dd/anim-drop.html Mon Nov 23 15:14:29 2009 +0100 @@ -0,0 +1,389 @@ + + + + + YUI Library Examples: Drag & Drop: Animated Drop Targets + + + + + + + + + + + + + + +
+
+
+

+ + YUI 3.x Home - + +

+
+ + +
+ + + +
+
+
+
+

YUI Library Examples: Drag & Drop: Animated Drop Targets

+
+
+ +

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

+ +
+
+
+
+ +

Drag & Drop: Animated Drop Targets

+ +
+

+

This example will show you how to make an animated node a Drop target.

+

+ +
+
+ +

+ + + View example in new window. + + +

+ + +
+
+
+ +

Setting up the HTML

+

First we will create our HTML.

+ +

Now we give that HTML some CSS to make it visible.

+ + +

Setting up the YUI Instance

+

Now we need to create our YUI instance and tell it to load the dd-drop, dd-plugin, dd-drop-plugin and anim modules.

+ + +

Making the Node draggable

+

Now that we have a YUI instance with the modules loaded, we need to instantiate the Drag instance on this Node.

+

In this example we will be using Node plugins to accomplish our tasks.

+ + +

Animating the Nodes

+

Now we will setup the Animation sequence that we want to run.

+ + +

Making the Node A Target

+

Using the dd-drop-plugin, we now need to make this animated Node a Drop Target.

+

To do that, we need to add the plugin after the fx plugin.

+ + +

Syncing the Target with the Animation

+

The Drop Target needs to be in sync with the animation, since we are changing the height, width, top and left style.

+

We do this by adding a listener to the tween event on the animation instance.

+ + +

Full example source

+ + +
+ +
+ +
+
+ + + +
+ +
+

Copyright © 2009 Yahoo! Inc. All rights reserved.

+

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

+
+
+ + + +