Index | OAT homepage | OpenLink Software

# OATDOCdrag

- OATDOCdrag
- _ _ drag.js
- _ _ _ _ Functions
- _ _ _ _ _ _ OAT.Drag.create(clicker, mover, optObj)
- _ _ _ _ _ _ OAT.Drag.remove(clicker, mover)
- _ _ _ _ _ _ OAT.Drag.removeAll(clicker)
- _ _ _ _ Constants
- _ _ _ _ _ _ OAT.Drag.TYPE_X
- _ _ _ _ _ _ OAT.Drag.TYPE_Y
- _ _ _ _ _ _ OAT.Drag.TYPE_XY
- _ _ _ _ Example

## 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});

Copyright (C) 2005-2008 OpenLink Software