drag($options = array())
Make an element draggable.
Options
•handle - selector to the handle element.
•snapGrid - The pixel grid that movement snaps to, an
array(x, y)
•container - The element that acts as a bounding box for the
draggable element.
Event Options
•start - Event fired when the drag starts
•drag - Event fired on every step of the drag
•stop - Event fired when dragging stops (mouse release)
Example use
$js->get('#element'); $js->drag(array(
'container' => '#content',
'start' => 'onStart',
'drag' => 'onDrag',
'stop' => 'onStop',
'snapGrid' => array(10, 10),
'wrapCallbacks' => false
)); If you were using the jQuery engine the following code would
be added to the buffer.
$("#element").draggable({containment:"#content", drag:onDrag,
grid:[10,10], start:onStart, stop:onStop});