进度条的制作

<style type="text/css">
*{ margin:0px auto; padding:0px}
#wai{ width:200px; height:10px; border:1px solid #60F;}
#nei{ width:0px; height:10px; background-color:#F33; float:left}
</style>
</head>

<body>

<div style="width:600px; height:300px; margin-top:30px">


<div id="wai">
<div id="nei">

</div>
</div>

<input type="button" value="开始" onclick="Start()" />
</div>

</body>
<script type="text/javascript">

function Start()
{
Bian();
}

var bfb = 0;
function Bian()
{
//将百分比变化
bfb= bfb+1;

//改变宽度
document.getElementById("nei").style.width = bfb+"%";

//判断
if(bfb<100)
{
window.setTimeout("Bian()",50);
}

}

</script>
</html>

posted @ 2016-09-23 16:12  夜雨声烦丶  阅读(96)  评论(0编辑  收藏  举报