Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ichord/simple-filedrop
https://github.com/ichord/simple-filedrop
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ichord/simple-filedrop
- Owner: ichord
- License: mit
- Created: 2014-11-12T15:15:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-08T03:38:38.000Z (about 10 years ago)
- Last Synced: 2024-11-07T18:16:17.310Z (3 months ago)
- Language: JavaScript
- Size: 184 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
simple-filedrop
=============[![Circle CI](https://circleci.com/gh/ichord/simple-filedrop/tree/master.png?style=badge)](https://circleci.com/gh/ichord/simple-filedrop/tree/master)
### 配置
* `el` 投放区域元素,jQuery 对象,class, id
* `types :Array` 允许投放的文件格式, 为字符串数组(Array), 比如 [`image/png`, `image/jpeg`]
* `hints :String` 投放区域的提示文字。### 事件
* `fileDropShown (event)` **开始拖入** 时显示投放区域 (drop zone)
* `fileDropHidden (event)` **放弃拖入后** 隐藏投放区域。
* `fileDrop (event, files)` 成功投放。
* `fileDropFail (file, message)` 投放成功后文件处理出错,比如错误的文件格式