060-manual.html (797B)
1 <!doctype html> 2 <title>drag & drop - dragging elements by children that are positioned outside them</title> 3 <style type="text/css"> 4 div { 5 height: 200px; 6 width: 200px; 7 background: blue; 8 white-space: nowrap; 9 position: relative; 10 } 11 span { 12 display: block; 13 top: 0; 14 left: 210px; 15 position: absolute; 16 width: 100px; 17 height: 100px; 18 background: orange; 19 } 20 </style> 21 <script type="text/javascript"> 22 window.onload = function () { 23 document.getElementsByTagName('div')[0].ondragstart = function (e) { 24 e.dataTransfer.effectAllowed = 'copy'; 25 e.dataTransfer.setData('text','dummy text'); 26 }; 27 }; 28 </script> 29 <div draggable="true"><span></span></div> 30 <p>Drag the orange square sideways. Pass if the drag placeholder shows that both the blue and orange squares are being dragged.</p>