class SAPO.Component.Draggable
Version:
1.1

requires SAPO.Dom.Element

requires SAPO.Dom.Event

requires SAPO.Dom.Css

requires SAPO.Utility.Dimensions

Makes an element draggable

Defined in Component/Draggable/1.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
  • [ Number fps ] - if defined, on drag will run every n frames per second only
  • [ DomElement droppableProxy ] - if set, a shallow copy of the droppableProxy will be put on document.body with transparent bg
  • [ String mouseAnchor ] - defaults to mouse cursor. can be 'left|center|right top|center|bottom'
  • [ Function onStart ] - callback called when dragging starts
  • [ Function onEnd ] - callback called when dragging stops
  • [ Function onDrag ] - callback called while dragging, prior to position updates
  • [ Function onChange ] - callback called while dragging, after position updates

Function Details

function destroy

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