DHTML – Hide until fully loaded

They have: 5,633 posts

Joined: Jan 1970

Basically what I’m trying to do is load a DHTML script behind scenes (right now all the layers load on top of each other then expand – which looks bad). And then once it’s loaded for it to appear. This is a navigation menu and that I wrote and downgrades for non-DHTML browsers. I’ve done this before.. Just can’t seem to remember the technique.

Thanks,

------------------
Adam
AIS Internet Solutions
[email protected]
www.aisinternet.com

They have: 231 posts

Joined: Feb 2000

Place your html inside a hidden layer.

code:

<div id="testLayer"
style="position:absolute;visibility:hidden;">HTML</div>[/code]

Then make it visible after page has loaded.

code:
<script>

function makeVis() {
   if (document.all) {
      document.all["testLayer"].style.visibility = "visible";
      }
   if (document.layers) {
      document.layers["testLayer"].visibility = "show";
      }
   }
 
onload = makeVis;

</script>[/code] 

:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.