2013-12-17 3 views
1

파일 업로드를 나타내는 간단한 jquery 진행률 막대가 있으며 각 업로드 후에 다시 설정하는 데 도움이 필요했습니다.jquery progress bar resting

내 마음에 ...하지만하지 작동해야 다음을 시도

, 당신은 잘못 당신이 value 변경해야 진행률 표시 줄의 position 변경하고있는

$('#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 + '%'); 
}); 

답변

관련 문제