dragDrop method
Initiates a drag-and-drop operation.
A call to the dragDrop method fires the ondragstart event.
Syntax:
You can find the related objects in the Supported by objects section below.
Return value:
Boolean. One of the following values:
The dragged content was not dropped. | |
The dragged content has been successfully dropped. |
Example HTML code 1:
This example illustrates the use of the dragDrop method:
|
||||
<head> <script type="text/javascript"> function InitDrag (elem) { // if right mouse button is down if (event.button & 2) { elem.dragDrop (); } } </script> </head> <body> <div onmousedown="InitDrag (this)" style="background-color:#e0d0a0; width:200px"> Select some text in this field and use the right mouse button for dragging! </div> <br /><br /> <div style="background-color:#a0d0e0; width:200px"> Dragging with the right mouse button is not allowed for this field! </div> <br /><br /> <textarea rows="5">The dragged text can be dropped into this field.</textarea> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
a, abbr, acronym, address, applet, area, b, bdo, big, blockquote, body, button, caption, center, cite, code, col, colgroup, dd, del, dfn, dir, div, dl, dt, em, embed, fieldset, font, form, frame, frameset, h1, h2, h3, h4, h5, h6, hr, html, i, iframe, img, input:button, input:checkbox, input:file, input:image, input:password, input:radio, input:reset, input:submit, input:text, ins, isindex, kbd, label, legend, li, listing, map, marquee, menu, nobr, noframes, object, ol, option, p, plaintext, pre, q, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, table, tbody, td, textarea, tfoot, th, thead, tr, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments