我用我的页面上悬浮窗上传图片,但由于某种原因它不拿起悬浮窗autoProcessQueue没有得到拿起
我在我的网页粘贴这段代码而选项“autoProcessQueue”,它仍然上传只要我在这个教程中选择图片:https://github.com/enyo/dropzone/wiki/Upload-all-files-with-a-button
Dropzone.options.myDropzone = {
// Prevents Dropzone from uploading dropped files immediately
autoProcessQueue: false,
init: function() {
var submitButton = document.querySelector("#submit-all")
myDropzone = this; // closure
submitButton.addEventListener("click", function() {
myDropzone.processQueue(); // Tell Dropzone to process all queued files.
});
// You might want to show the submit button only when
// files are dropped here:
this.on("addedfile", function() {
// Show submit button here and/or inform user to click it.
});
}
};
你错过了这一点。他需要autoProcessQueue = false,因为他想用提交按钮来提交它,而不是自动提交。 – KVISH