onBeforeDrag

fires before the mouse button is pressed and the cursor is moved over a draggable item

boolean onBeforeDrag(object context,Event native_event);
contextobjectthe drag-n-drop context
native_eventEventan HTML event object
booleanreturning false will prevent dragging of the element

Example

$$("editor").attachEvent("onBeforeDrag", function(context, native_event){
    // handler logic
});

Details

The drag-and-drop context can have the following properties:

  • from - the source object
  • to - the target object
  • source - the ID of the dragged item
  • target - the ID of the drop target, null for dropping on empty space
  • start - the ID from which drag-n-drop was started.
See also
Back to top