https://github.com/tpkn/dnd
Yet another wrapper for "drag and drop" action, one of the millions of similar
https://github.com/tpkn/dnd
Last synced: 3 months ago
JSON representation
Yet another wrapper for "drag and drop" action, one of the millions of similar
- Host: GitHub
- URL: https://github.com/tpkn/dnd
- Owner: tpkn
- License: mit
- Created: 2018-01-30T17:40:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-16T12:00:26.000Z (almost 6 years ago)
- Last Synced: 2025-01-14T08:12:54.069Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DnD
Yet another wrapper for "drag and drop" action, one of the millions of similar. Just pass by...
## API
```javascript
new DnD(target[, options]);
```### target
**Type**: _Object_
DOM element### options.drop
**Type**: _Function_### options.over
**Type**: _Function_### options.out
**Type**: _Function_## Usage
```javascript
var dnd = new DnD(document.getElementById('drop'), { drop: onDropHandler });function onDropHandler(e, files, text){
console.log('files:', files);
console.log('text:', text);
}
```