Drag & Drop: Drop Based Coding
+ ++
This example shows how to use the Drop Target events to code your application.
+ + +Setting up the HTML
+First we need to create the HTML for the example.
+ +Now we give the HTML some CSS to make them visible.
+ + +Setting up the YUI Instance
+Now we need to create our YUI instance and tell it to load the dd-drop and dd-constrain modules.
Making the Nodes draggable
+Now that we have a YUI instance with the dd-drop module, we need to instantiate the Drag instance on each Drag Node.
In this example we are using the data config option of the drag to associate data with this Drag instance.
+So we have set up an object literal containing information about our drag items.
+ +Now we walk through the nodes and create a drag instance from each of them.
+ + + +Setting up the Drop Target
+Here we set up the Drop Target and assign a listener to it.
+ + +