Adds event handlers for an element's drag gesture
- onmove
function
handler for moving
- onstart
function
handler for drag start
- onend
function
handler for drag end
- mcontext
object
context for moving handler
- scontext
object
context for drag start handler
- econtext
object
context for drag end handler
Additionaly following drag
events are triggered: drag.start.<id>
on start,
drag.end.<id>
on end and drag.move.<id>
on every move. When element is dragged over another element
drag.over.<id>
fires as well.
Start event and start handler are called in specified context or in context of the element with following parameters:
-
x
number
x position of the mouse
-
y
number
y position of the mouse
-
event
object
DOM event object
Move event and move handler are called in specified context or in context of the element with following parameters:
-
dx
number
shift by x from the start point
-
dy
number
shift by y from the start point
-
x
number
x position of the mouse
-
y
number
y position of the mouse
-
event
object
DOM event object
End event and end handler are called in specified context or in context of the element with following parameters:
-
event
object
DOM event object
Returns:
object
Element