首页 > 代码库 > 做进度条

做进度条

<!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=utf-8" />
<title>无标题文档</title>
<style type="text/css">
*{ margin:0px auto; padding:0px;}
#waikuang{ width:200px; height:10px; border:1px solid #000;}
#jindu{ height:10px; background-color:#00F; float:left;}
</style>
</head>

<body>
<br />
<div id="waikuang">
<div id="jindu" style="width:0px;"></div>
</div>
</body>
</html>
<script type="text/jscript">

jindu();
function jindu()
{
    var div = document.getElementById("jindu");
    
    var a = div.style.width; 
    
    var cd = a.substr(0,a.length-2);
    
    if(cd<200)    
    {
        var cd = parseInt(cd)+2;    
    }
    div.style.width = cd+"px";
    
    window.setTimeout("jindu()",20);
    
    
        
}

</script>

 

做进度条