DragModule

Getting Started

How To Make an Object Draggable

By now, I assume that you have downloaded the package.

If you have not already done so, download the package and save a duplicate copy. I'll use the example in the /droptarget/ directory.

To create a draggable object for an element with the id folder, you would call the following code onload.

    var folder = DragObj.getInstance(document.getElementById("folder"));
		

The element must be positioned with relative or absolute positioning.

DragObj.constraints

To constrain the drag object to a vertical or horizontal plane, pass a constraint to the DragObj.getInstance method.

		// horizontal constraint.
    var folder = DragObj.getInstance(document.getElementById("folder"), 
        DragObj.constraints.HORZ);
		
		// vertical constraint.
    var folder = DragObj.getInstance(document.getElementById("folder"), 
        DragObj.constraints.VERT);
		

Next in this tutorial:

 

*AnimTree
*Tabs
*GlideMenus
*DragLib