2013-09-25 58 views
2

我用我的页面上悬浮窗上传图片,但由于某种原因它不拿起悬浮窗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. 
    }); 

    } 
}; 

回答

-1

你必须寻找到我们的代码,ü做出 autoProcessQueue:假的,

使其真正

autoProcessQueue:真实, 并在dropzone.js 还要检查该参数的值,并改变它也有,它肯定会工作..

+2

你错过了这一点。他需要autoProcessQueue = false,因为他想用提交按钮来提交它,而不是自动提交。 – KVISH

0

我有同样的问题,结果证明我使用的是Dropzone的过时版本。 autoProcessQueue功能仅在v3.6.0中添加,因此请确保至少使用该功能。