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: about 1 month 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 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-16T12:00:26.000Z (almost 7 years ago)
- Last Synced: 2025-12-04T22:53:58.214Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- 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);
}
```