Drag and drop of HTML5

Source: Internet
Author: User

-draggable Tag file drag and drop

99 IE5 Start, 05 after all browser support (except Opera)

<li id=be draggable=true ondragstart= "StartDrag (event)" >Brussels</li>

The interface provided at this time

var dragstart = function(evt) {    evt.dataTransfer.setData (' text ', evt.target.id);  }; 

-File drag and drop example

<div ondragenter= "return false;" Ondragover= "return  false;"   ondrop= "Drop (event)" >& #x2397;</div>
var drop = function(evt) {     var file = evt.datatransfer.files[0];  };  var dataurlreader = new FileReader ();  Dataurlreader.onloadend =  function() {     imgelem.src = dataurlreader.result;     imginfo.innerhtml = File.name+ ' (' +_inkb (file.size) + ') ';} dataurlreader.read asdataurl (file); var BinaryReader = new FileReader (); binaryreader.onload = function() {var exif = Findexifinjpeg (binaryrea Der.result); for (Var key in Exif) {exifinfo.innerhtml + = _asrow (Key,exif[key]);}}; binaryreader.readasbinarystring (file) ;

-File API and drag-and-drop


-Contenteditable and SpellCheck

Editable labels and automatic spell check labels

  <p contenteditable=true> Text to be     edited ...  </p>  <p contenteditable=true spellcheck=true> Text to be     edited ...  </p> 

Drag and drop of HTML5

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.