Are you looking for how to make an element draggable?
The Draggables object is a global helper object. In most cases you will not need to use or modify the Draggables object, except when adding/removing custom drag observers.
|drags||Array of all Draggables on the page|
|observers|| Array of drag observers. Use
|register()||function(draggable). Called when you create a new Draggable?. If this is the first Draggable on the page, starts observing mouse events necessary for dragging.|
|unregister()|| function(draggable). Called by Draggable.destroy()?. Stops observing window mouse events if
|activate()|| Marks a particular Draggable as the
|updateDrag()|| Passes the window
|endDrag()|| Caught by the window’s
|keyPress()|| Passes the window
|addObserver()|| Adds an observer to
|removeObserver()|| Removes an observer from
|notify()|| Calls the observers’
A draggable observer, as used in
Draggables.addObserver(), is an object with an element property defined, and one or more of the following functions defined:
|onStart()||called after drag begins|
|onDrag()||called on each mousemove during a drag|
|onEnd()||called when drag is finished|
The parameters passed to these three events are
eventName, one of
draggable, a reference to the Draggable?. The
draggable.elementproperty is a reference to the DOM element being dragged.
event, the DOM Event object