JS效果的进度条

直接贴代码吧!

<html>

<body>

<center>
<table cellspacing=0 cellpadding=0 bgcolor=#00FFFF width=40% id=P><tr><td>load进度条
<table cellspacing=0 cellpadding=0 bgcolor=#0000FF height=18 id=Q><tr><td id=v></td></tr></table></td></tr></table>
</center>

<script language="javascript">
var R = 0; 
function load() 
{
R = R + 2; 
var q = document.getElementById("Q");
q.style.width =  R + "%";
document.getElementById("v").innerHTML=q.style.width;
time= setTimeout(load,500);
if (R > 100) 
{
clearTimeout(time);
//document.getElementById("P").style.width=0;
document.getElementById("P").style.display="none";
}
}
load();
</script>
</body>
</html>

 

 

你可能感兴趣的:(进度条)