我用我的頁面上懸浮窗上傳圖片,但由於某種原因它不拿起懸浮窗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