Hide Until Page Finishes Loading

  • Talks_44
  • Newbie
  • Newbie
  • Talks_44
  • Posts: 11
  • Loc: http://www.new-talks.com

Post 3+ Months Ago

Good afternoon all,

I am looking for a example of a site with a "Hide Until Page Finishes Loading" feature, as I wanted to test whether it was SE friendly as I am looking to create a loading page for one of my clients.

Many thanks,
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • wphilipw
  • Student
  • Student
  • wphilipw
  • Posts: 87
  • Loc: PA, US

Post 3+ Months Ago

well I dont know of any sites that use it off hand if an example is what you are looking for, but if you want some code, here it is.

Code: [ Select ]
<html>
<head>
<title>hide until load</title>
<script type="text/javascript">
function init() {
document.getElementById('loading').style.display = 'none';
document.getElementById('main').style.display = 'block';
}
window.onload = init();
</script>
</head>
<body>
<div id="main" style="display: none">Page Contents here.</div>
<div id="loading">please wait, page is loading...</div>
</body>
</html>
  1. <html>
  2. <head>
  3. <title>hide until load</title>
  4. <script type="text/javascript">
  5. function init() {
  6. document.getElementById('loading').style.display = 'none';
  7. document.getElementById('main').style.display = 'block';
  8. }
  9. window.onload = init();
  10. </script>
  11. </head>
  12. <body>
  13. <div id="main" style="display: none">Page Contents here.</div>
  14. <div id="loading">please wait, page is loading...</div>
  15. </body>
  16. </html>


please remember that if you try this on your local machine you will almost certainly not have time to see the loading screen since the page will load near instantly.

cheers!

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 81 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.