2
我正在使用图片上传器。问题在于图片上传器仅向我显示ajax进度条图片,但没有任何百分比。Ajax加载进度条百分比
如何在下面的代码中实现百分比(与进度栏相关)?
jQuery.itemForm.submitFormIfNotImageLoading =函数(loadingTime){
if (jQuery.uploaderPreviewer.loadingImages()) {
if(loadingTime > $.itemForm.loadingTimeout) {
var settings = {
title: $.itemForm.messages.timeoutTitle,
message: $.itemForm.messages.timeoutMessage,
buttons: { 'OK': function() { $(this).dialog("close"); } }
};
$.globalFunctions.openDialog(settings);
}
else {
loadingTime += $.itemForm.checkingIntervalTime;
var progressBarValue = $("#progressbar").progressbar('value')
+ $.itemForm.progressBarInterval;
$("#progressbar").progressbar('value', progressBarValue);
var recursiveCall = "$.itemForm.submitFormIfNotImageLoading(" + loadingTime + ")";
setTimeout(recursiveCall, $.itemForm.checkingIntervalTime);
}
}
else {
submitForm();
}
};
function showImageLoadingMessage() {
var options = {
title: $.itemForm.messages.savingTitle,
message: $.itemForm.messages.savingMessage
};
$.globalFunctions.openDialog(options);
$("#progressbar").progressbar({
value: 0
});
var progressBarInterval = $.itemForm.checkingIntervalTime * 100/$.itemForm.loadingTimeout;
if (progressBarInterval != Number.NaN) {
$.itemForm.progressBarInterval = Math.floor(progressBarInterval);
}
};
您正在寻找HTML5解决方案还是旧的学校方法? – VAShhh 2012-07-05 13:30:18
我正在寻找一个老派的方法 – techAddict82 2012-07-05 14:14:41