Last active
March 14, 2017 13:55
-
-
Save pcote/127ad73ce5866b899300e7fbb52cd599 to your computer and use it in GitHub Desktop.
The first version of drag and drop for a tutorial I'm doing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dragHandler = function(evt){ | |
evt.preventDefault(); | |
}; | |
var dropHandler = function(evt){ | |
evt.preventDefault(); | |
var files = evt.originalEvent.dataTransfer.files; | |
console.log(files[0]); | |
}; | |
var dropHandlerSet = { | |
dragover: dragHandler, | |
drop: dropHandler | |
}; | |
$(".droparea").on(dropHandlerSet); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment