原文链接:http://www.iew3c.com/code-sharing/6672.html
一个真正的网页LOADING,不是装模作样的,网页真正加载完才显示,若没加载完则一直显示进度条,你可以试一下。
<title>网页Loading</title> <body onLoad="location.href = url;" style='overflow:hidden;overflow-y:hidden'> <script language="JavaScript"> var url = 'http://www.163.com'; </script> <div align=center> <font class=fontbig>页面加载中...... <style><!--.proccess{border:1px solid;8;height:8;background:#ffffff;margin:3}--></style> <div align="center"> <form method=post name=proccess> <script language=javascript> for(i=0;i<30;i++)document.write("<input class=proccess>") </script> </form> </div></td></tr></table> <div align="center"> <script language=JavaScript>var p=0,j=0; var c=new Array("lightskyblue","white") setInterval('proccess();',100) function proccess(){ document.forms.proccess.elements[p].style.background=c[j]; p+=1; if(p==30){p=0;j=1-j;}} --></script> </div> </div> <div align="center"> <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> </div>