PDA

View Full Version : html page preload script problem in NS 6


wedge
09-17-2002, 10:01 PM
I have a script that will preload an html page without using an additional page or redirecting script. With some help I was able to get this script to hide flash elements until the html images were completely loaded in IE browsers. This does not work properly in NS 6 however. In NS6 you will see the loading text while the html loads but the flash navigation remains hidden when the html images are done. I am not sure if this is a syntax problem or incorrect formatting of the DOM structure. Any help would be greatly appreciated.
Here's the script originated by Gilbert Davis and modified to hide the flash by Kuckus.

thanks,
Wedge

<html>
<head>
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function loadImages() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById("hidepage").style.visibility="hidden";
document.getElementById("hideflash").style.visibility="visible";
}
else {
if(document.layers){ //netscape 4
document.hidepage.visibility="hidden";
document.hideflash.visibility="visible";
}
else { // IE 4
document.all.hidepage.style.visibility = "hidden";
document.all.hideflash.style.visibility = "visible";
}
}
}

</script>

</head>

<body onload="loadImages()">

<div id="hidepage" style="position:absolute; top:0px; left:0px; height:100%; width:100%;">

<table width="100%" height="100%" border="0"><tr><td align="center" valign="center"><font face="verdana" color="#ffffff" ><B>Loading...</b></font></td></tr></table></div>


html content here


<div id="hideflash" style="visibility:hidden;">

flash navigation here

</div>

</body>
</html>

umm
09-17-2002, 10:41 PM
Off the top of my head, try this...

if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById("hidepage").style.display="none";
document.getElementById("hideflash").style.display="block";
}



I'd test it in the other browsers but my pc blew up :eek: and I don't have the browsers installed on this machine yet.

wedge
09-18-2002, 06:13 PM
Thanks for your reply umm. Your solution brings me back to where I started unfortunately. Your script will hide the html of the page during it's loading, but the flash navigation appears before the page is done loading. I am trying to get everything to appear at the same time. The script I listed works in IE but not in ns 6. Let me know if you have any ideas.

Thanks again,

wedge