<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form name=loading>
<p>
<!--进度条加载时上面那行的提示-->
<font color="#0066ff" size="2" face="Arial">载入中,请稍等...</font><br>
<!--进度条-->
<input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; padding:0px; border-style:none;">
<br>
<!--进度条加载的进度-->
<input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-medium; border-style:none;">
</p>
</form>
</body>
</html>
<script>
var bar = 0; //初始变量的值
var line = "||"; //定义的进度条
var amount = "||"; //定义的进度条
count();
function count(){
bar = bar + 2; //变量每次加2
amount = amount + line; //两个进度条进行的拼接
document.loading.chart.value = amount; //进度条
document.loading.percent.value = bar + "%"; //进度条显示的进度,也是拼接
if(bar < 99){
setTimeout("count()", 100); //只要变量小于99,每100毫秒循环调用一次
} else{
window.location = "夜空下的星星.html"; //进度条加载完成(100%时)跳转页面
}
}
</script>