日期:2014-05-16 浏览次数:20374 次
<script></body>
var div=document.getElementById("rt");//得到这个DIV。
div.style.width=runtime+'%';
var runtime=document.getElementById("rt");
var seconds = 100;
function close_page(){
runtime.innerHTML = seconds;
if(seconds == 0)
window.close();
else
window.setTimeout('close_page()',1000);
seconds--;
}
</script>
<!DOCTYPE html>
<html>
<head>
<title>进度条</title>
</head>
<style type="text/css">
#rt{
border:1px solid #069; text-align:center; background:#f5f6fb; color:#0a0; font-size:12px; line-height:25px;
}
</style>
<body onload = "close_page()">
<div id="rt"></div>
<script>
var div = document.getElementById("rt");
var seconds = 100;
function close_page(){
div.innerHTML = seconds;
div.style.width = seconds + "%";
if(--seconds == 0){
window.close();
}else{
setTimeout(close_page, 1000);
}
}
</script>
</body>
</html>