Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide layer when page is fully loaded!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hoping to get help with how to hide a top layer when page is fylly loaded. The layer should be visible from the start containing some sort of info like: "wait while loading" so that the visitor don't start clicking links until the whole page is loaded, witch craches the page. When fully loaded = layer hides.
 
DHTML can be quite complicated - you need different code for IE and NS browsers. This code doesn't take Netscape6 into account, which has yet a third way of doing it apparrently - I've not used it yet.

Matt.

<html>
<head>
<title>Untitled</title>
<script language=&quot;JavaScript&quot;>
<!--

function loaded(){
ns=(navigator.appName.indexOf('Netscape')>=0)? true:false

if (ns) {

document.first.visibility='hide'
document.main.visibility='show'
} else {
document.all.first.style.visibility='hidden'
document.all.main.style.visibility='visible'
}
}
//-->
</script>

<body onload=&quot;loaded()&quot;>

<div id=&quot;main&quot; style=&quot;position: relative; visibility:hidden&quot;>
loaded now
</div>

<div id=&quot;first&quot; style=&quot;position: relative; visibility:visible&quot;>
<table width=&quot;100%&quot; height=&quot;100%&quot;><tr><td><center>
Loading page...
</center>
</td></tr></table>
</div>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top