我有一个简单的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 + '%');
});
答案 0 :(得分:2)
更改position
所需的进度条的value
是错误的做法:
$( ".progress" ).progressbar({ value: 25 });