NeXTSTEP Programming Mastermind
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

drag-and-drop-files

0.0.1 • Public • Published

drag-and-drop-files

Handle file drag and drop events in an HTML5 capable browser with less Yak shaving.

Example

var dropTarget = document.querySelector("#dropTarget")
 
require("drag-and-drop-files")(dropTarget, function(files) {
  console.log("Got some files:", files)
})

Install

npm install drag-and-drop-files

require("drag-and-drop-files")(element, callback(files) )

Hooks a listener for a file data transfer event.

  • element is the DOM element to listen for file events on
  • callback(files) is a callback that gets fired when the files are dropped on to it. The argument files is an array of all the file objects that were dragged onto the element.

Credits

(c) 2013 Mikola Lysenko. MIT License

install

npm i drag-and-drop-files

Downloadsweekly downloads

60

version

0.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability