In the HTML5 to implement drag-and-drop operation, relative to the previous implementation through the mouse operation, it is much simpler, data security is more secure. It takes only a few steps to do this.
Adds an attribute to the dragged element draggable , if it is a file drag and
HTML5 Code Case StudyHTML5 code has a id,id= "Tuo", there is a ondragstart= "drag (Event)" Property, then this is what the meaning of it, it is followed by a function drag (event), This means that the function is called when we start to drag, and we can see the dragstart here, which is the action that we started to
Drag-and-drop is a common feature of dragging objects to another location, in HTML5, where drag and drop is part of the standard and any element can be dragged and dropped.1. HTML5 Drag
piece of text, then call the SetData method to save the text in the text format, drag the picture will be in the format of the URL to save the data. Event.dataTransfer.setData ("text", "some text"); Working with textvar text = event.dataTransfer.getData ("text");Event.dataTransfer.setData ("URL", "http://www.wrox.com/"); Working with a URL (image)var url = event.dataTransfer.getData ("url"); This is the beginning of IE allows the two type
-draggable Tag file drag and drop99 IE5 Start, 05 after all browser support (except Opera)The interface provided at this timevar dragstart = function(evt) { evt.dataTransfer.setData (' text ', evt.target.id); }; -File drag and drop examplevar drop = function(evt) { var file = evt.datatransfer.files[0]; }; var
H5 has added an API for drag-and-drop, which allows any element of an HTML page to become draggable by dragging and dropping the API. This is a small example to help understand.HTML> Head> MetaCharSet= "Utf-8"> Metaname= "Author"content= "Dongfeng"> title>HT
I was going to write an example that supports drag and drop upload of multiple images. But for better understanding, I would like to introduce the drag and drop of HTML5.
Drag and drop
[Open-source applications] Use HTTPHandler + resumableJs + HTML5 to drag and drop to upload [large] files,
Preface:
Transmission of large files has always been a major technical difficulty. When the file size is too large, it is unrealistic to submit all the content to the memory. There is also a problem with large files: whether resumable and multi-file simultan
= Ev.currentTarget.firstElementChild; Replace the TGT ev.currentTarget.replaceChild (SRC, tgt) with SRC; Srcparent.appendchild (TGT); var sourceIndex = $ (src). attr ("index"); var Targetindex = $ (TGT). attr ("index"); There is a saved index value if (localstorage.indexs) {var indexs = Localstorage.indexs; Indexs = Indexs.replace (SourceIndex, "*");
Encoding environment: Asp.net mvc3 HTML5
Running Environment: the Firefox browser passes.
I. For the HTML5 drag-and-drop function, refer to the introduction on the Internet. I will summarize my learned knowledge points as follows:
1: Global Property draggable
Draggable, a global attribute with the
(1) Implementing drag-and-drop in HTML5 requires setting the "draggable" property of the target element to "true";(2) Related events that are triggered when the element is dropped:a:dragstart--is triggered when a drag-and-drop element is started (Event body:
Comments: Do not use javascript to implement drag-and-drop effects, which has always been what netizens want to see. Second, html5 today provides the following details for you. For more information, see
In Web development, Javascript is needed to implement drag-and-drop effe
Simple drag and drop in the HTML5Drag-and-drop is a common feature that grabs an object and then drags it to another location. In HTML5, drag-and-drop is part of the standard, and any element can be dragged and dropped.In order fo
HTML5 's drag and drop is a very good feature, more examples of online use such as Http://html5demos.com/drag, but the majority of these examples are not practical, this article will be a bit of a useful example, through the drag and Dro
How does HTML5 implement drag-and-drop of elements?
I am afraid many front-end users do not know how to implement HTML5 drag-and-drop operations. This article describes how to implement HTML5
property is set to true.
Drag an element using the Ondragstart event. SetData () sets the Get element.
The Datatransfer.setdata () method sets the data type and value to be dragged:function drag (EV) {Ev.dataTransfer.setData ("Text", ev.target.id);}Drag (event) declares a method that specifies the data to be dragged, the type is "text", and t
HTML5-based Drag and Drop generates image Base64 information,
HTML5 Drag and Drop is a very good function, the use of more examples online such as http://html5demos.com/drag, but most o
Through the HTML file API, Firefox, Chrome and other browsers have supported the direct drag of files from the operating system, and uploaded to the server.
This is a revolutionary advance relative to the HTML form that has been used for more than 10 of years. Although IE's backwardness lets many developers still wait and see, but the Gmail mailbox attachment drag
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.