drag.js
Provides dragging (moving) capability for any DOM node
Functions
OAT.Drag.create(clicker,
mover, optObj)
Modifies element mover such that clicking and
moving on clicker will cause it to move. Additional
options can be specified using optObj object:
-
type
- one of the constants, specifies
direction in which element may be dragged
-
restrictionFunction
- callback which
specifies movement restriction
-
endFunction
- callback to be executed
when dragging ends
-
magnetsH
- array of elements to
horizontally snap to
-
magnetsV
- array of elements to
vertically snap to
-
cursor
- bool, automatically adjust CSS
cursor
OAT.Drag.remove(clicker,
mover)
Removes dragging relation between clicker and
mover.
OAT.Drag.removeAll(clicker)
Removes all dragging relations from clicker.
Constants
OAT.Drag.TYPE_X
ToBeDone
OAT.Drag.TYPE_Y
ToBeDone
OAT.Drag.TYPE_XY
ToBeDone
Example
var header = Dom.create("div");
var body = Dom.create("div");
body.appendChild(header);
OAT.Drag.create(header, body, {type:TYPE_XY});