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
Using HTML file APIs, Firefox, chrome, and other browsers can drag and drop files from the operating system and upload them to the server.
Compared with HTML forms that have been used for more than 10 years, this is a revolutionary progress. Although many developers are still waiting for the Internet Explorer to lag behind, the drag-and-
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
1. Two div to drag and drop the picture back and forth, directly on the code:Style CSSDomDivID= "Div1"OnDragOver= "OnDragOver (event)"OnDrop= "OnDrop (event)">Div>BR>DivID= "Div2"OnDragOver= "OnDragOver (event)"OnDrop= "Onbackdrop (event)"> imgID= "IMG1"src=".. /images/gif.gif "draggable= "true"ondragstart= "Ondragstart (event)"/>Div>Js2. Note the following:A. The function name cannot be the same as the
Next we will introduce a small clock that we have made to facilitate drag and drop.
So how to insert it into your own interface?
Just add the following code:
The complete code of clcok. JS is as follows:
VaR extra = Document. createelement ('div ');Extra. style. Position = 'absolute ';VaR extra_canvas = Document. createelement ('canvas ');Extra_canvas.id = "extra_canvas ";Extra. appendchild (extra_canvas )
Js implements the drag-and-drop function for controlling files and obtaining drag-and-drop content. js drag-and-drop
When you drag a file to an element in the browser, js can listen to
The implementation of drag-and-drop functionality is not provided in Silverlight itself, and the drag-and-drop functionality is accomplished with its event support (MouseLeftButtonDown, MouseLeftButtonUp, and MouseMove). In practice, we can encapsulate the drag-and-
In Silverlight itself does not provide the implementation of drag-and-drop functions, to implement the drag-and-drop function with its event support (MouseLeftButtonDown, MouseLeftButtonUp and MouseMove) to complete, in practical applications we can Encapsulates a drag-and-
HTML5 drag function drag, html5 drag
1. Create a drag objectSet the draggable attribute for the element to be dragged. It has three values:True: the element can be dragged;False: the element cannot be dragged;Auto: the browser det
Jquery plug-in jquery. dragscale. js implements the drag and drop method to change the element size (with demo source code download), jquery drag and drop drag
This document describes how to drag and
Drag effect believe that many friends have written their own, whether you use the original JS or jquery to achieve it is very simple, but today I would like to introduce the use of the HTML5 standard defined in the native drag events to achieve the drag effect.First, background: In fact, it is
Keywords: Super drag-and-drop, getdroptarget, ondragover, ihtmldatatransfer 1. Overview The Ghost window browser provides a type of browser called "Super drag-and-drop" (or "Super drag-and-drop" or "
drag an element in the window, do not set the position of the parent element of the dragged element to position it relative to the body.
If you need to locate the body, but you need to set the position of its parent element to a non-static one, you can expand the plug-in.
I hope this article will help you learn about javascript programming.
Articles you may be interested in:
Baidu Popup. js pop-up box evolutionary version
Design drag-and-drop operationsThe main contents of this section are as follows:1. How to start dragging and dropping;2. How to respond to events during dragging and dropping;3. How to respond to falling events;4. How to end a drag-and-drop operation.Start draggingThe user starts dragging with a
Android development-Implementation of Drag-and-Drop gestures using the Drag Drop framework, androiddrag
Android3.0 provides the drag/drop framework, which enables drag-and-
Using the Android drag-and-drop framework, you can allow users to move data from one view object in the current layout to another view object using a graphical drag-and-drop gesture . This framework includes: drag-and-drop event c
ANDROID3.0 provides a Drag/drop framework that allows you to drag and drop a view into another view in the current layout using drag-and-drop. This article describes how to use the 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.