Its good to restrict Page Access until The Page Completely Loaded.
Demo
HTML to be added to the Page
  1. <div id="spinner"></div>  

CSS on the Page
  1. #spinner {  
  2. positionfixed;  
  3. left: 0px;  
  4. top: 0px;  
  5. width100%;  
  6. height100%;  
  7. z-index9999;  
  8. backgroundurl(Image/preloader-w8-cycle-black.gif) 50% 50% no-repeat #808080;  
  9. }  

JavaScript On the Page
  1. <script type="text/javascript">  
  2. // <![CDATA[  
  3. $(window).load(function () { $("#spinner").fadeOut("slow"); })  
  4. // ]]></script>  

Complete HTML
  1. <html>  
  2. <head>  
  3. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>  
  4.  <style>  
  5.  
  6.         #spinner {  
  7.             position: fixed;  
  8.             left: 0px;  
  9.             top: 0px;  
  10.             width: 100%;  
  11.             height: 100%;  
  12.             z-index: 9999;  
  13.             *background: url(Image/preloader-w8-cycle-black.gif) 50% 50% no-repeat #808080;  
  14.         }  
  15.     </style>  
  16.     <!-- Preloader --><script type="text/javascript">// <![CDATA[  
  17.                       $(window).load(function () { $("#spinner").fadeOut("slow"); })  
  18.                       // ]]></script>  
  19. </head>  
  20. <body>  
  21. <div id="spinner"></div>  
  22. </body>  
  23. </html>  

0 comments:

Post a Comment