标签:meta rip html 实现 har ade 进度 get doctype
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
body{
margin: 0;
padding: 0;
}
header{
width: 1000px;
top: 50px;
border: 1px solid #000;
margin: 0 auto;
}
div{
width: 1%;
height: 50px;
line-height: 50px;
background:#0ff;
font-size: 30px;
text-align: right;
}
</style>
<script>
//使用定时器实现进度条效果
window.onload = function(){
var color = document.getElementById("color") ;
var i = 1;
setInterval(function(){
i++;
color.style.width=i+"%";
color.innerHTML = i+"%";
if(i>=100){
i=1;
}
},50)
}
</script>
</head>
<body>
<header>
<div id="color"></div>
</header>
</body>
</html>
标签:meta rip html 实现 har ade 进度 get doctype
原文地址:http://www.cnblogs.com/R-jia-bao/p/6143028.html