HTML5 drag-and-drop API (related focus)

Source: Internet
Author: User

  1. DataTransfer object: The medium that the object is used to pass, used generally as event.datatransfer.
  2. Draggable Property: is the label element to set the draggable=true, otherwise there will be no effect, for example:
    <div title= "Drag Me" draggable= "true" > List 1</div>
  3. Ondragstart Event: An event that is triggered when a drag element starts being dragged, and this event acts on the dragged element
  4. OnDragEnter Event: An event that fires when a dragged element enters the target element, which acts on the target element
  5. OnDragOver Event: An event that is triggered when a drag element is moved on the target element, which acts on the target element
  6. OnDrop event: The dragged element on the target element with the mouse release of the triggered event, which acts on the target element
  7. Ondragend Event: An event triggered when a drag is completed, which acts on the dragged element
  8. Event.preventdefault () Method: Prevents execution of the default event methods. Be sure to perform preventdefault () in OnDragOver,
  9. Otherwise the OnDrop event will not be triggered. In addition, if you are dragging things in from other applications or files, especially pictures,
  10. The default action is to display the image or related information, not to actually perform the drop. At this point, you need to use the document OnDragOver event to kill it directly.
  11. Event.effectallowed property: Is the effect of drag and drop.

HTML5 drag-and-drop API (related focus)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.