Javascript Reference
Categories: dataTransfer

javascript dataTransfer dropEffect, effectAllowed

@March 15, 2008, 1:22 a.m.
dropEffect, effectAllowedFirefox/Netscape/NN n/a IE 5 Chrome/Safari/DOM n/a  

Read/Write  

These two properties work together but at different stages along a dragging operation that involves the dataTransfer object. They both control the appearance of the cursor during the drag and drop process. Assign a cursor style at the beginning of a drag operation via the ondragstart event and effectAllowed property. The drop target's ondragover and ondragenter event handlers should set the dropEffect property to the desired cursor style, and also set the event.returnValue property to false. This opens the way for the ondrop event handler not only to set the cursor via the dropEffect property, but to process the drop action. See Example 9-1 for a simple demonstration of the interaction of all these events and properties.

 
Example
 
event.dataTransfer.dropEffect= "copy";
 
Value

Case-insensitive constant (as a string): copy | link | move | none.

 
Default

none


Powered by Linode.