<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="0">
<title>预加载中....</title>
<style type="text/css">
<!--
.p { font-family: "MS Shell Dlg"; font-size: 12px}
-->
</style>
</head>
<body onLoad="location.href = url" oncontextmenu="window.event.returnValue=false" ondragstart="window.event.returnValue=false" onselectstart="event.returnValue=false">
<script language="JavaScript">
<!--
var url = 'http://www.niudun.com';
function jump(){
location=url;
return true;
}
//-->
</script>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" width="401" bordercolorlight="#808080" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#F5F5F5" width="402"> <div id=process style="width: 400; height: 10"> </div>
<script>
var num=0;
function mypro()
{
num++;
process.innerHTML=process.innerHTML+'<font color="#0000FF">■</font>';
if(num<26){setTimeout("mypro()",200);}else{process.innerHTML="";num=0;mypro()}
}
mypro();
</script>
</td> <script>
<!--
if (document.layers)
document.write('<Layer src="' + url + ' " VISIBILITY="hide"> </Layer>');
else
if (document.all || document.getElementById)
document.write('<iframe src="' + url + '" style="visibility: hidden;"></iframe>');
else location.href = url;
//-->
</script>
</tr>
</table>
</center>
</div>
<p align="center"><font class="p"><b>网站正在装载中,请稍候......</b></font></p>
</body>
</html>
网页代码:让用户等待若干秒才能点的表单按钮,页面读取进度条脚本.....
我先来一个:
oracle_basic 让用户等待若干秒才能点的表单按钮。
<FORM name=sform action=reg_2.asp method=post><INPUT class=input type=submit value="我同意" name=submitbtn></FORM>
<SCRIPT language=javascript>
<!--
var secs = 15;
var wait = secs * 1000;
document.sform.submitbtn.disabled=true;
for(i=1;i<=secs;i++) {
window.setTimeout("update(" + i + ")", i * 1000);
}
window.setTimeout("timer()", wait);
function update(num) {
if(num == (wait/1000)) {
document.sform.submitbtn.value = "我同意";
}
else {
printnr = (wait/1000)-num;
document.sform.submitbtn.value = "请先阅读服务条款 (剩余时间" + printnr + ")";
}
}
function timer() {
document.sform.submitbtn.disabled=false;
}
//-->
</SCRIPT>
---------------------------------------------------------------
页面读取进度条脚本
复制代码到head
<style type="text/css">
/* Container of Loader */
#seLoader
{
width : 200px; /* set width of loader */
z-index : 1;
margin : auto;
}
/* Box around loadbar */
#seLoadBox
{
height : 12px; /* set height */
z-index : 3;
border : 1px solid;
padding : 1px;
background-color : #efefef;
font-size : 0px;
text-align : left;
}
/* loadbar */
#seLoadBar
{
width : 0%;
height : 100%;
z-index : 4;
background : #f90;
}
/* text (%) */
#seLoadTxt
{
z-index : 5;
margin-top : -14px;
font : 10px Verdana,Geneva,sans-serif;
}
</style>
<script src="seLoader.js" type="text/javascript"></script>
<script type="text/javascript">
load = new seLoader('img/') // make loader object and set the directory (dir optional)
load.runAtEnd('setTimeout(\'viewPage()\',10)') // run a script after loading (optional)
load.setImgs // set the images
(
'Image1.gif','Image2.gif','Image3.gif','Image4.gif','Image5.gif','Image6.gif','Image7.gif',
'Image8.gif','Image9.gif','Image10.gif','Image11.gif','Image12.gif','Image13.gif','Image14.gif','Image15.gif',
'Image16.gif','Image17.gif','Image18.gif','Image19.gif'
)
function viewPage()
{
location.replace('http://www.ceocio.net')
}
function initLoader()
{
load.load()
}
onload=initLoader
</script>
注明:
前半部分是设定进度条的颜色和规格
load = new seLoader('img/') // make loader object and set the directory (dir optional)
这里是设定读取图片的位置
(
'Image1.gif','Image2.gif','Image3.gif','Image4.gif','Image5.gif','Image6.gif','Image7.gif',
'Image8.gif','Image9.gif','Image10.gif','Image11.gif','Image12.gif','Image13.gif','Image14.gif','Image15.gif',
'Image16.gif','Image17.gif','Image18.gif','Image19.gif'
)
这里是读取图片的名字
复制代码到body
<div align="center">
<script>load.drawLoader('now loading...')</script>
</div>