【发布时间】:2013-12-17 07:31:14
【问题描述】:
我有一个表示文件上传的简单 jquery 进度条,我希望在每次上传后重置它。
我已经尝试了以下在我看来应该可行的方法......但不是,
$('#fileupload').fileupload({
dataType: 'json',
url: 'Home/UploadFiles',
autoUpload: true,
done: function (e, data) {
$('.file_name').html(data.result.name);
$('.file_type').html(data.result.type);
$('.file_size').html(data.result.size);
alert("File was uploaded");
$('.file_name').html("");
$('.file_type').html("");
$('.file_size').html("");
//this is where I am attempting to reset the bar after 1.5 secs
setTimeout(function () {
$('#progress .progress-bar').css('width', 0);
}, 1500);
}
}).on('fileuploadprogressall', function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('.progress .progress-bar').css('width', progress + '%');
});
【问题讨论】:
标签: jquery progress-bar reset blueimp