resize.js
Provides resizing capability for any DOM node.
Functions
OAT.Resize.create(clicker, mover, type[,
restrictionFunction[, endFunction]])
Modifies element such that clicking and moving on
clicker will cause it to resize.
-
clicker
- ID or DOM element
-
mover
- ID or DOM element
-
type
- one of the
OAT.Resize.TYPE_ constants; specifies resizing
direction(s).
-
restrictionFunction
- function with bool
result which tells if resizing is permitted (optional)
-
endFunction
- function performed at the
end of resize task (optional)
OAT.Resize.remove(clicker,
element)
Removes resizing relation between clicker and
element.
OAT.Resize.removeAll(clicker)
Removes all resizing relations from clicker.
Constants
OAT.Resize.TYPE_
Tells which direction resizing is permitted.
-
OAT.Resize.TYPE_X
- X-axis only
-
OAT.Resize.TYPE_Y
- Y-axis only
-
OAT.Resize.TYPE_XY
- both axes
Example
var corner = OAT.Dom.create("div");
var body = OAT.Dom.create("div");
body.appendChild(corner);
OAT.Resize.create(corner, body, OAT.Resize.TYPE_XY);