1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script> 5 function onDragStart(event) { 6 var dragImage = document.getElementById('dragImage'); 7 event.dataTransfer.setDragImage( 8 dragImage, dragImage.offsetWidth / 2, dragImage.offsetHeight / 2); 9 } 10 </script> 11 </head> 12 <body> 13 <p><img id="dragImage" src="resources/webkit-background.png"> 14 <p>Try dragging the image or the link below. The drag image should be 15 identical to the image above, centered on the cursor. 16 <p><a href="#" ondragstart="onDragStart(event)">Drag Me</a> 17 <p><img src="resources/3dolph.gif" ondragstart="onDragStart(event)"> 18 </body> 19 </html> 20