Regardless of the language used for development, the progress bar is often used in file upload and download. This article will share with you two simple progress bars for javascript implementation, one for personal production and the other for netizens, they are all very good. we recommend them to coders here. For more information about coders, see. Example 1:
Process Bar《script》var t; function s(c){ if(c<=100) { val.style.width=c+"%"; percent.innerHTML=c+"%"; btn.disabled=true; btnp.disabled=false; c=c+10; t=setTimeout("s("+c+")",500); } else { clearTimeout(t); btnc.disabled=false; btnp.disabled=true; return; }} function c(){ clearTimeout(t); val.style.width="0px"; percent.innerHTML="0%"; btn.disabled=false; btnc.disabled=true; btnp.disabled=true; btnp.value='Pause';} function p(){ var temp; if('Pause' == btnp.value) { clearTimeout(t); btnp.value='Go on'; btnc.disabled=false; } else { temp=val.style.width; btnp.value='Pause'; var k=parseInt(delEnd(temp)); s(k); btnc.disabled=true; } } function delEnd(str){ var temp=""; for(var i=0; i < str.length-1; i++) { temp=temp+str[i]; } return temp; }《script》
0%
Let's share a. net
Create a WEB project, add a new project> HTML page, and name it progressbar.htm. the content is as follows:
No title page