html5--Drag and drop

Source: Internet
Author: User

Basic situation

In the HTML5 specification, we can set whether this element can be dragged by adding draggable= "true" to the element, where the image and link are turned on by default.

Drag and drop elements

The elements of the draggable= "true" property are set on the page

Target element

Any element can be a target element

Event Monitoring

 //  drag element  Ondrag //  applied to the drag element, the entire drag process will be called  ondragstart //   applied to the drag element, called when the drag starts  ondragleave //  applies to drag elements that call  ondragend //  
when dragging ends
// The target element ondragenter    // applies to the target element and calls OnDragOver      // applied to the target element when the drag element enters. called OnDrop//applied to the target element when stuck on the target element          , called when the Mouse is released on the target element ondragleave    //  Applies to the target element, which is called when the mouse leaves the target element

html5--Drag and drop

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.