返回首页
当前位置: 主页 > 网络编程 > .Net实例教程 >

实现页面载入时的Loading效果程序代码

时间:2011-05-24 14:56来源:知行网www.zhixing123.cn 编辑:麦田守望者

<html>    
     <head>    
     <title></title>    
     <script type="text/javascript">    
         var url = 'http://www.google.co.uk/search?hl=en&q=asp.net&meta='; //the Next page you want to display  
     </script>    
     <style>    
         .loading-indicator {    
             font-size:8pt;    
             background-image:url(../images/loading/loading.gif);    
             background-repeat: no-repeat;      
             background-position:top left;    
             padding-left:20px;    
             height:18px;    
             text-align:left;    
         }    
         #loading{    
             position:absolute;    
             left:45%;    
             top:40%;    
             border:3px solid #B2D0F7;    
             background:white url(../images/loading/block-bg.gif) repeat-x;    
             padding:10px;    
             font:bold 14px verdana,tahoma,helvetica;    
             color:#003366;    
             width:180px;    
             text-align:center;    
         }    
     </style>    
     <div id="loading">    
         <div class="loading-indicator">    
             Page Loading     
         </div>    
     </div>    
     </head>    
     <body onload="location.href = url;" style="overflow:hidden;overflow-y:hidden">
     </body>    
     <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>    
</html>
效果图:
------分隔线----------------------------
标签(Tag):C# C#实例教程 c#基础教程 C#源代码
------分隔线----------------------------
推荐内容
猜你感兴趣