-webkit-user-drag property
Specifies whether the element is draggable.
In Firefox, use the draggable attribute for similar functionality.
JavaScript page for this property: webkitUserDrag. You can find other example(s) there. |
Possible values:
One of the following values:
Browser determines whether the element is draggable or not. | |||||||
The element itself is draggable instead of its contents. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
Default. Element is not draggable. |
Default: none.
Example HTML code 1:
This example illustrates the use of the -webkit-user-drag property:
|
||||
<head> <style> .dragTest { width:150px; height:80px; background-color:#e0f0e0; } </style> <script type="text/javascript"> function OnDragStart (event) { event.dataTransfer.setData ("text/plain", event.target.textContent); return true; } </script> </head> <body> The first division element is draggable, the second one is not. Try to drag the first one and drop it into the text field. <br /><br /> Division 1. <div class="dragTest" style="-webkit-user-drag: element; -webkit-user-select:none;" draggable="true" ondragstart="return OnDragStart (event)">A draggable division element.</div> <br /><br /> Division 2. <div class="dragTest" ondragstart="return false;">A non-draggable division element.</div> <br /><br /> Text field:<br /> <textarea rows="5"></textarea> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
a, abbr, acronym, address, b, bdo, big, blockQuote, body, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldSet, font, form, H1, H2, H3, H4, H5, H6, html, i, ins, isIndex, kbd, label, legend, li, marquee, menu, ol, p, pre, q, s, samp, small, span, strike, strong, sub, sup, table, td, textArea, th, tr, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments