1
上傳我的文件後,我希望能夠將其移出DropZone HTML元素並放入LI項目中。如何處理DropZone.js文件上傳完成
HTML Structur
<div class="dropzone"> FROM HERE.jpg </div>
<ul>
<li>TO HERE.jpg</li>
</ul>
JS
$(function() {
// event listeners
var myDropzone = new Dropzone("div#mydrop", { url: "/images/upload/"});
//NOT WORKING
myDropzone.on("addedfile", function(file) {
file.previewElement.addEventListener("click", function() {
});
//feedback
Dropzone.options.myDropzone = {
init: function()
{
this.on("success", function(file, responseText) {
//do stuff
});
this.on("complete", function(file) {
//do stuff
});
this.on("addedfile", function(file) {
//do stuff
});
this.on("uploadprogress", function(file) {
//do stuff
});
}
};
});