Html程序  |  20行  |  657 B

<!DOCTYPE html>
<html>
  <head>
    <script>
      function onDragStart(event) {
        var dragImage = document.getElementById('dragImage');
        event.dataTransfer.setDragImage(
            dragImage, dragImage.offsetWidth / 2, dragImage.offsetHeight / 2);
      }
    </script>
  </head>
  <body>
    <p><img id="dragImage" src="resources/webkit-background.png">
    <p>Try dragging the image or the link below. The drag image should be
    identical to the image above, centered on the cursor.
    <p><a href="#" ondragstart="onDragStart(event)">Drag Me</a>
    <p><img src="resources/3dolph.gif" ondragstart="onDragStart(event)">
  </body>
</html>