onBeforeDrop

fires before a dragged element is released over the droppable area

boolean onBeforeDrop(object context,Event native_event){ ... };

Parameters

contextobjectthe drag-n-drop context
native_eventEventan HTML event object

Returns

booleanreturning false will prevent further drag-and-drop processing

Example

some.attachEvent("onBeforeDrop", function(context, native_event){
    //... some code here ... 
    // return false to block operation
    return true;
});

Related samples

Details

If you drag multiple items, the event will be called once for the entire batch of items.

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(s)
  • target - the id of the drop target, null for drop on empty space
  • start - the id from which drag-n-drop was started
See also
Back to top