javascript 自定义进度条

来源:互联网 发布:淘宝刷欢乐豆原理2017 编辑:程序博客网 时间:2024/06/03 20:48

    javascript自定义进度条 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script type="text/javascript" src="jquery-1.9.1.min.js"></script></head><script type="text/javascript">var num=0;var maxCount=10000;var intervalId=null;var width=10;//progress barfunction progressbarFun(){  //  debugger;    num++;// 处理    if(num==maxCount){  clearInterval(intervalId);}else{  var cc=num%30;     $("#progressbar").width(cc*width); //document.getElementById("progressbar").style.width=cc*width;}}// 间歇执行intervalId=setInterval(progressbarFun,300);</script><body style="background-color:#999999">   <div style="height:20px;width:300px;"> <div id="progressbar" style="background-color:#FF0000;height:20px;z-index:10000;width:10px"></div></div></body></html>




1 0