|
想不到竟然这么多朋友想知道我的载入画面是怎么做的~~呵呵,好像这个在PJBlog的论坛上曾经见过,不过还是再写一篇日志吧。演示嘛,还是看我的网站就看到了。www.x-force.cn 首先,打开header.asp,在[head]的后面,插入以下代码: www.x-force.cn 程序代码 <%'=======X-Force添加的Loading界面==========%> <style type="text/css"> #loader_container { text-align:center; position:absolute; top:40%; width:100%; left: 0; } #loader { font-family:Tahoma, Helvetica, sans; font-size:11.5px; color:#000000; background-color:#FFFFFF; padding:10px 0 16px 0; margin:0 auto; display:block; width:230px; border:1px solid #5a667b; text-align:left; z-index:2; } #loader_bg {background-color:#e4e7eb; position:relative; top:8px; left:8px; height:7px; width:213px; font-size:1px} #progress { height:5px; font-size:1px; width:1px; position:relative; top:1px; left:0px; background-color:#77A9E0 } </style> <script language="JavaScript"> //读取框 var t_id = setInterval(animate,20); var pos=0; var dir=2; var len=0; function animate() { var elem = do***ent.getElementById('progress'); if(elem != null) { if (pos==0) len += dir; if (len>32 || pos>179) pos += dir; if (pos>179) len -= dir; if (pos>179 && len==0) pos=0; elem.style.left = pos; elem.style.width = len; } } function remove_loading() { this.clearInterval(t_id); var targelem = do***ent.getElementById('loader_container'); targelem.style.display='none'; targelem.style.visibility='hidden'; initJS(); } </script> <%'============X-Force添加的Loading界面==========%> 然后,找到:www.x-force.cn 程序代码 <body onload="initJS()" onkeydown="PressKey()"> 将其修改为:www.x-force.cn 程序代码 <body onload="remove_loading()" onkeydown="PressKey()"> <%'===========X-Force的Loading界面==========%> <div id="loader_container"> <div id="loader"> <div align="center"> 本站靓靓の页面正在很用力de加载中... <br> 版权归 www.X-Force.cn 所有 </div> <div id="loader_bg"><div id="progress"> </div></div> </div> </div> <%'===========X-Force的Loading界面==========%> 好了,就这么简单。www.x-force.cn 本文转载自『异次元の世界』http://www.x-force.cn/article.asp?id=102
|