forked from feross/drag-drop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
35 lines (35 loc) · 1019 Bytes
/
example.html
File metadata and controls
35 lines (35 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<html>
<head>
<title>drag-drop example</title>
<style>
body {
height: 100%;
}
.drag {
border: 5px solid red;
}
</style>
</head>
<body>
<h1>Drag something onto this page</h1>
<script src="dragdrop.min.js"></script>
<script>
window.remove = DragDrop('body', {
onDrop: function (files, pos, fileList, directories) {
window.files = files
console.log('onDrop: ' + files.length + ' files at ' + pos.x + ', ' + pos.y)
files.forEach(function (file) {
console.log('- ' + file.name + ' (' + file.size + ') (' + file.type + ')')
})
console.log('files array', files)
console.log('FileList object', fileList)
console.log('directories array', directories)
},
onDropText: function (text, pos) {
window.text = text
console.log('onDropText: ' + text + ' at ' + pos.x + ', ' + pos.y)
}
})
</script>
</body>
</html>