DragLib

Core Module

Tutorial

DragLib is very easy to use. Just call the method DragObj.getInstance, like this:

    DragObj.getInstance(oElement);
    DragObj.getInstance(oElement, iConstraint);
		

If you have not already done so, download the package and save a duplicate copy.

This tutorial is divided into sections:

  1. How To Make an Object Draggable
  2. Instance Methods
    • setHandle(oElement) - Drag the object by a handle
    • getContainerWidth - Returns the width of a drag object's container
    • getContainerHeight - Returns the height of a drag object's container
    • moveToX, moveToY - move the DragObject instance
    • addDropTarget (see Drop Targets)
    • removeDropTarget (see Drop Targets)
  3. Drop Targets
  4. Event Handlers
    • onbeforedragstart
    • ondragstart
    • onbeforedrag
    • ondrag
    • ondragstop
    • ondragend
    • ondragdrop

About the Sourcecode

In order to minimize file size, whitespace has been removed from dragC.js.

Human readable source-code is available in the zip file (see drag.js).

Next in this tutorial:

 

*AnimTree
*Tabs
*GlideMenus
*DragLib