Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 1.09 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Display div while page loads (all JS and HTML/CSS)
  2. <script type="text/javascript">
  3. function showContent(){
  4. //hide loading status...
  5. document.getElementById("loading-grid-page").style.display='none';
  6.  
  7. //show content
  8. document.getElementById("content").style.display='block';
  9. }
  10. </script>
  11. </head>
  12. <body onload="showContent()">
  13. <script type="text/javascript">
  14. document.write('<div id="loading-grid-page">Fetching ALL the gold...</div>');
  15. </script>
  16. <div id="content">
  17. <script type="text/javascript">
  18. //hide content
  19. document.getElementById("content").style.display='none';
  20. </script>
  21.        
  22. #loading-grid-page {
  23. color: #ffffff;
  24. font: 700 11px/25px 'proxima-nova-1', 'proxima-nova-2', sans-serif;
  25. letter-spacing: 1px;
  26. text-transform: uppercase;
  27. background: #111111 url('images/ajax-loader-black.gif') no-repeat 15px center;
  28. border-radius: 2px;
  29. border: 1px solid #111111;
  30. padding: 5px 30px;
  31. text-align: center;
  32. width: 200px;
  33. position: fixed;
  34. left: 50%;
  35. top: 50%;
  36. margin-top: -50px;
  37. margin-left: -100px;
  38. z-index: 1000000;
  39. }
  40.        
  41. $(window).load(function(){
  42.     //hide loader div here
  43.     $("#loading-grid-page").hide();
  44. });