方法一(動畫效果):
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Loading</title>
</head>
<body>
<form name="loading">
<p align="center">正在跳轉,請稍后...</p>
<p align="center">
<input type="text" name="bar" style="border-style:none; background-color:#D3E8D0; font-weight:bold" />
<input type="text" name="percentage"style="border-style:none; background-color:#FFFFFF; max-width:30px"/>
</p>
<p align="center">
如果您的瀏覽器不支持跳轉,請點擊<a href="http://www.126.com">這里</a>手動跳轉
</p>
<script language="javascript" type="text/javascript">
var percent=0; //百分比進度,顯示在滾動條后面
var element="||"; //滾動條單元豎線
var elements="||"; //滾動條當前豎線
count(); //開始調用循環
function count(){
percent=percent+10; //每次百分比加10
elements =elements + element; //滾動條當前豎線增加一個滾動條單元豎線
document.loading.bar.value=elements; //設置窗體loading表單中bar元素的當前值
document.loading.percentage.value=percent+"%"; //設置窗體loading表單中percentage元素的當前值
if (percent<99){ //percent小于99則繼續循環
setTimeout("count()",500); //每500ms進行一次count()
}
else{
window.location = "http://www.126.com"; //percent達到100時跳轉
}
}
</script>
</form>
</body>
</html>
方法二:
<html>
<head>
<meta http-equiv="refresh" content="3; url=http://www.126.com">
</head>
<a href="http://www.126.com">如果您的瀏覽器沒有自動跳轉,請點擊這里<a/>
</html>
posted on 2008-06-16 18:16
Hank1026 閱讀(1018)
評論(0) 編輯 收藏 所屬分類:
每日積累