Community Support
January 09, 2009, 08:47:23 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Staff List Login Register  
Pages: [1]
  Print  
Author Topic: Simple Javascript Pre-loader  (Read 37 times)
Burke
New User
*
Offline Offline

Hosting Plan: Premium Hosting
Posts: 5
Referrals: 0



WWW
« on: June 30, 2008, 08:36:15 PM »

My friend HTMLstig has this nice little Pre-Loader script:

Step 1:

In the <HEAD> tags, place the following code:

Code:
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function clearPreloadPage() { //DOM
if (document.getElementById){
document.getElementById('prepage').style.visibility='hidden';
}else{
if (document.layers){ //NS4
document.prepage.visibility = 'hidden';
}
else { //IE4
document.all.prepage.style.visibility = 'hidden';
}
}
}
// End -->
</SCRIPT>

Step 2:

Change the <body> tag into: 

Code:
<BODY onLoad="clearPreloadPage();">

Step 3:

Straight after the new Body tag, place the following code:

Code:
<div id="prepage" style="position:absolute; font-family:arial; font-size:16; left:0px;

top:0px; background-color:white; layer-background-color:white; height:100%; width:100%;z-index:500;">
<table width=100%><tr><td>Loading ... ... Please wait!</td></tr></table>
</div>

TIP: You can change this to show a different message
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC | Sitemap | Archive Valid XHTML 1.0! Valid CSS!