文件上传进度条修改

 

 一、setInterval   

onProgress: function(file, loaded, total) {
            var eleProgress= _this.find('#fileupload_'+instanceNumber+'_'+file.index+' .uploadify-progress');
            var progressBar = eleProgress.children('.uploadify-progress-bar');
            var timer=null;
            timer=setInterval(function(){
                var iWidth=progressBar[0].offsetWidth/eleProgress[0].offsetWidth*100;
                progressBar[0].style.width=progressBar[0].offsetWidth+0.5+'px';
                progressBar[0].innerHTML=Math.round(iWidth)+"%";
                if(iWidth==99){
                    clearInterval(timer);
                }
            },10);
          },

 

 

 

 

 

-----

  srouce:【1】http://www.zzjs.net/html/414.html

     【2】jquery setInterval()

posted @ 2016-08-16 17:20  半天的半天  阅读(316)  评论(0编辑  收藏  举报