Element.drag(onmove, onstart, onend, [mcontext], [scontext], [econtext])
优质
小牛编辑
127浏览
2023-12-01
Adds event handlers for an element's drag gesture
Parameters
- onmovefunctionhandler for moving
- onstartfunctionhandler for drag start
- onendfunctionhandler for drag end
- mcontextobjectcontext for moving handler
- scontextobjectcontext for drag start handler
- econtextobjectcontext 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:
- xnumberx position of the mouse
- ynumbery position of the mouse
- eventobjectDOM event object
Move event and move handler are called in specified context or in context of the element with following parameters:
- dxnumbershift by x from the start point
- dynumbershift by y from the start point
- xnumberx position of the mouse
- ynumbery position of the mouse
- eventobjectDOM event object
End event and end handler are called in specified context or in context of the element with following parameters:
- eventobjectDOM event object
Returns: objectElement