Discover html5 drag and drop file upload example, include the articles, news, trends, analysis and practical advice about html5 drag and drop file upload example on alibabacloud.com
1. Set elements to drag and drop first2. Drag the element whose EV is draggedID of the Ev.target.id elementWhere to put it?function AllowDrop (EV){Ev.preventdefault ();}function drag (EV){Ev.datatransfer. setData ("Text", ev.target.id);}3. Where to placefunction Drop (EV) {e
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,
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
Original: http://www.open-open.com/code/view/1437358795584In the project development due to the actual needs, the need to develop drag-and-drop upload function, ok!Look first:JSP upload front-end code:class= "title" > the latest masterpiece of the Legend of the night! Java implementation
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);}
Comments: Call preventDefault () to prevent the browser from processing data by default (the default action of the drop event is opened in the form of a link) through dataTransfer. the getData (Text) method obtains the dragged data. If you are interested, refer
Original Effect
Effect After dragging
The Code is as follows:
The Code is as follows:[Code][/Code]It may seem a little complicated, but we can study the different parts of
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
Uploading is basically a recurring item in a project, usually using:1. Form submission2. Flash3, HTML5Form submission will refresh the page, it is difficult to do asynchronous upload, flash may be used more, because it can take into account almost all browsers, I have been using jquery uploadify as a project upload tool, Uploadify also based on HTML5 seems to be
Today, a new problem, is the picture dragged upload to the server, in general, we will think of using Ajax, but now the problem is that Ajax default is no commit event, that is, we drag and drop upload pictures, we can not send the uploaded image information to the server, this time we have to simulate the form form of
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
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
This is the effect: before dragging After:On the code:Daily sentence: I always knew looking back on the tears would make me laugh, but I never knew looking back on the laughs would make M E cry.I know that when I look back, those tears want to laugh, but I do not know how to look back, those laughter can also call me to tears.A drag-and-drop technique for sharing HTML5
Java implementation drag-and-drop uploadIn the project development due to the actual needs, the need to develop drag-and-drop upload function, ok!Look first:JSP upload front-end code:OK, after writing the foreground code, in the b
OSS Object storage is a secure, low-cost, high-reliability cloud storage Service, this paper takes the image upload and seven Qiniu storage as an example to realize the OSS storage function.
PHP Seven Cow cloud installation
Installing with composer
#安装 Composer Curl-ss Https://getcomposer.org/installer | php# use Composer to get the latest version of Qiniu SDK PHP Composer.phar require qiniu/php-sdk# code
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.