日期:2014-05-16  浏览次数:20443 次

JavaScript实现载入页面进度条


<form name=loading>
<p align=center> <font color="#ff0000" size="2" face="Arial">载入中,请稍等...</font><br>
<input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#ff0000; background-color:#fef4d9; padding:0px; border-style:none;">
<br>
<input type=text name=percent size=47 style="color:#ff0000; text-align:center; border-width:medium; border-style:none;">

<script language="JavaScript">
<!--
var bar=0               
var line="||"
var amount="||"
count()                 
function count(){
bar=bar+2
amount =amount + line
document.loading.chart.value=amount        
document.loading.percent.value=bar+"%"    
if (bar<99)               
{setTimeout("count()",100);} 
else                   
{window.location.href = "
http://www.sina.com.cn";}
}
//-->
</script>
</p>
</form>