1
我在magento中使用dropzone.js上傳文件。進度條工作正常,但我也想顯示進度百分比。以下功能正在爲一個範圍添加樣式。如何在dropzone.js中顯示上傳進度百分比
uploadprogress: function(a, b) {
var c, d, e, f, g;
if (a.previewElement) {
for (f = a.previewElement.querySelectorAll("[data-dz-uploadprogress]"), g = [], d = 0, e = f.length; e > d; d++) c = f[d], g.push("PROGRESS" === c.nodeName ? c.value = b : c.style.width = "" + b + "%");
return g
}
},
它在下面的html中添加style =「width:xx%」。
我也想顯示%結果哪個克在上面的代碼在span中返回作爲文本,以便用戶也可以看到數字。
這個效果很好。我想添加到這個解決方案的解決方案,所以誰讀這個誰可能想知道它在選項中,所以要添加到這些選項這樣做:'Dropzone.options.dropzoneIDHere = {uploadresolving:function(file,progress,bytesSent ){ } };' – fungusanthrax