Netscape Layers - displaying and hiding layers

They have: 5,633 posts

Joined: Jan 1970

How do you set the visibility of a layer in Netscape? I do not know how to reference the layer. I have no problems in IE4.

document.all("NAME").style.visibility = "hidden/visible";

Do I have to use the <ilayer> tag? I will have text in this layer that can be turned on or off.

----------
[email protected]
http://go.to/hass

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

I think you can get to it using
a layers array:

document.layers[0].?
or
document.layer[0].?

The question mark being the command or object we are looking for, now if I can just remeber if the layer tag does the visible/invisible thing... Shocked

They have: 5,633 posts

Joined: Jan 1970

<Jonh Pollock> Thanks for your reply. You were on the right track with your references. This is how I found the solution - if your interested!

if (document.all) {
document.all("movingLayer").style.visibility = "visible";
}
if (document.layers) {
document.layers["movingLayer"].visibility = "visible";
}

<div id="movingLayer" style="position:absolute; width:340px; left:40px; top:20px;">CONTENT HERE</div>

You can check out the result at http://home.primus.com.au/lloydhass/scsearchmenu/index.html. The thing I have created has no purpose really - it was just an experiment in moving layers around the screen.

----------
[email protected]
http://go.to/hass

They have: 5,633 posts

Joined: Jan 1970

I was always a bit scared of dynamic html and especially layers because I have had so many problems with netscape in the past. But after completing this project and finding an easy solution, I think I will start playing around with DHTML again.

They have: 2,390 posts

Joined: Nov 1998

That's it, you've decided me, I'm gonna start looking at yayers a bit more.
ANy comments advice on them?
JP

----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center

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.