国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

javascript實現簡單的-進度條

2019-11-02 15:43:30
字體:
來源:轉載
供稿:網友

   本文給大家分享2個javascript實現簡單的進度條,一個是個人制作一個是網友實現的,都很不錯,這里推薦給大家。

  示例一:

  ?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 <!doctype html> <html> <head> <meta charset="utf8"> <title>Process Bar</title> <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> </head>   <body> <div id="bar" style="width:300px; height:30px; border:solid 1px; float:left;"> <div id="val" style="height:100%; background-color:#03F; width:0px;"></div> </div> <div id="percent" style="float:left; line-height:30px;">0%</div> <div style="clear:both"></div> <br /> <input id="btn" type="button" value="Start" onClick="s(0)" />
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 丘北县| 京山县| 宜城市| 东阳市| 元谋县| 右玉县| 白朗县| 绥化市| 建宁县| 瑞昌市| 册亨县| 上饶县| 汤原县| 萨嘎县| 昔阳县| 永丰县| 新和县| 南乐县| 聂拉木县| 明光市| 永宁县| 伊春市| 化州市| 乃东县| 西畴县| 遂宁市| 潼南县| 来安县| 株洲县| 桐庐县| 日照市| 武乡县| 中江县| 阿城市| 金湖县| 托克逊县| 星子县| 鄂尔多斯市| 龙川县| 桑植县| 黄冈市|