Alibabacloud.com offers a wide variety of articles about drag and drop website builder html5, easily find your drag and drop website builder html5 information here online.
With the rapid development of smartphones, the drag-and-drop feature has become a fashion. However, is it still lacking in our browsers? In the new HTML5 standard, there is a drag-and-drop standard. As part of the HTML5 standard,
Html5 drag and drop
1) create a source project
1.1) value of the draggable attribute:
True -- this element can be dragged;
False -- the element cannot be dragged;
Auto-the browser can decide whether an element can be dragged;
1.2) events of the dragged element:
Dragstart -- triggered when the element is dragged;
Drag-t
In HTML5Page DevelopmentIna very important point in the drag-and-drop operation is that we want to determine where the drag-and-drop event occurred. As the name implies, drag and drop events, that is, the removal (
DataTransfer object: The medium that the object is used to pass, used generally as event.datatransfer.
Draggable Property: is the label element to set the draggable=true, otherwise there will be no effect, for example:
Ondragstart Event: An event that is triggered when a drag element starts being dragged, and this event acts on the dragged element
OnDragEnter Event: An event that fires when a dragged element enters the target element, which acts
external dragged file, returns a list of Fileslist, and fileslist a type property that returns the types of the fileOdiv.ondrop = function (EV) {Ev.preventdefault (); var fs = Ev.dataTransfer.files;Alert (fs.length)//alert (Fs[0].type)for (var i=0; I. length; i++) { if ( fs[i].type.indexof (' image ')! =-1) { //using the Returned Type property value string contains an image to determine the file typevar fd = newFileReader (); //Read file information Fd
This is a very creative html5svg chat box drag-and-drop elastic rocking animation effects. The user can use the mouse to click or swipe the specified area on the chat box, the area will be a very elastic spring effect to open the Chat user list. When you click on a profile picture, you switch to the chat screen with the same flex effect, and the avatar is moved to the top right corner of the chat screen. Th
1. AudioYour browser does not support the audio element.Insert prompt text for The 2. VideoYour browser does not support the video tag.The 3. Drag and Dropvar box1,box2,imgWindow.onload = function () {Box1 = document.getElementById ("Box1");Box2 = document.getElementById ("Box2");Box2.ondragstart = function (e) {Drag (e);}Box2.ondragover = function (e) {DragOver (e);}Box2.ondrop = function (e) {OnDrop (e);}
Note: links, images are draggable by default.The MouseMove will not be triggered during the entire drag-and-drop process.DragStart settings:e.datatransfer.effectallowed = "Move";E.datatransfer.setdata ("text", e.target.innerhtml);E.datatransfer.setdragimage (e.target, 0, 0);return true;Dragend settings:E.datatransfer.cleardata ("text");return false;DragEnter settings:return true;DragOver settings:E.preventd
Html5 supports multi-image preview upload and drag-and-drop controls,
An easy-to-use control was found during Image Upload. Multiple images can be uploaded at the same time. You can click and select an image or drag the image to the upload box for direct upload, which is convenient and easy to use, the interface is als
An object provided in the HTML5 standard for file input and output (I/O)File: represents a Document objectFileList: represents a list of files, class array objectsFileReader for extracting content from filesFileWrite is used to write a class tolerance to a file.These objects need to be accessed and retrieved through E.datatransfer in the H5
Feeling drag and pull is very interesting, just start playing, simple summary, there is nothing wrong place welcome correct, thank you for further updatesSimple summary of HTML5 drag and drop
of events:Ondragstart-ondrag-ondragenter-ondragover-ondragleave/ondrop-ondragendNote: 1. If you want to trigger the OnDrop event, you need to block the default event in OnDragOver (the element is not allowed to be placed by default).2. In Firefox 3.5+, if you drag and drop the image onto the drop target, the page will turn to the image file, and if you
Tencent Weibo has also been near implementation of drag and drop upload. It's actually very simple.
Because there is no server support in the article can not do upload demo, download the instance
what support is needed to drag and drop uploads
1: Browser support drop event
Reprinted please indicate the source: http://blog.csdn.net/lmj623565791/article/details/31513065
The previous article has implemented the overall HTML and CSS of this project:HTML5 CSS3 typical case: Drag and Drop upload of images without a plug-in (PreView and batch upload are supported) (1)
This blog is completed directly on the basis of the previous article. The final result is as follows:
1:
2:
Okay.
Ondragover= "AllowDrop (event)" >Set elements to be dragged and droppedFirst, to make an element draggable, set the Draggable property to True:ondragstart= "Drag (Event)" Width= "336" height= ""/>HTML5 Drag and drop instance
After you create a custom drop target on your desktop, you can drag and drop the file from the desktop onto that target. Similar to dragging and dropping a picture or link, dropping the file from the desktop onto the browser triggers the drop event. It is also possible to read the placed file in Event.dataTransfer.file
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.