API/libsapojs/SAPO/Component/Draggable

[Elements] are optional

Class SAPO.Component.Draggable


class SAPO.Component.Draggable

requires SAPO.Dom.Element

requires SAPO.Dom.Event

requires SAPO.Dom.Css

requires SAPO.Utility.Dimensions

Makes an element draggable

Defined in Component/Draggable/0.1/lib.js

Constructor Summary
Draggable (String|DOMElement element, [Object options])

Function Summary
Removes the ability of the element of being dragged

Constructor Details

constructor Draggable

Draggable(String|DOMElement element, [Object options])
Parameters:
element - target element
[options] - options object
  • [ String constraint ] - Movement constraint. None by default. Can be either vertical or horizontal.
  • [ Number top ] - top limit for the draggable area
  • [ Number right ] - right limit for the draggable area
  • [ Number bottom ] - bottom limit for the draggable area
  • [ Number left ] - left limit for the draggable area
  • [ String|DOMElement handler ] - if specified, only this element will be used for dragging instead of the whole target element
  • [ Boolean revert ] - If true, reverts the draggable to the original position when dragging stops
  • [ String cursor ] - cursor type used over the draggable object
  • [ Number zindex ] - zindex applied to the draggable element while dragged
  • [ Function onStart ] - callback called when dragging starts
  • [ Function onEnd ] - callback called when dragging stops
  • [ Function onDrag ] - callback called while dragging
  • [ Function onChange ] - callback called while dragging, after position updates

Function Details

function destroy

destroy()
Removes the ability of the element of being dragged