This works fine in IE, and its not throwing any javscript errors in ns6+ or in ie, but it won't change the visibility in netscape.
I have tried document.layer['div_name'].style.visibility as well, but to no prevail.
I have got them to hide now, but only by setting the nested styles for each div to "hidden" which is strange as I thought netscape sued hide and show, not hidden and visible?
Here is the code, am I missing something?
-Jason
Comments
:
: I have tried document.layer['div_name'].style.visibility as well, but to no prevail.
:
: I have got them to hide now, but only by setting the nested styles for each div to "hidden" which is strange as I thought netscape sued hide and show, not hidden and visible?
:
: Here is the code, am I missing something?
JASON: I have found that with NS 4.78 (not sure about the new ones)
if you make a , and don't make it visible as default, you will not be able to un-hide it...
so, if for example you use:
[code]
[layer stuff in here...]
[/code]
your layer will [red][b]never[/b][/red] be seen, even if you use:
[code]
//this is NS4 javascript
document.layers['gimp'].style.visibility = "show";
[/code]
but... if you start the layer with:
[code]
[layer stuff in here...]
[/code]
your layer [red][b]can[/b][/red] be seen, and if you want to hide it you [red][b]can[/b][/red] use:
[code]
//this is NS4 javascript
document.layers['gimp'].style.visibility = "hide";
//and to unhide use:
document.layers['gimp'].style.visibility = "show";
[/code]
of course IE5+ is much easier, it doesn't have these hard coding rules, in fact you could document.write(); out the whole page and it will still recognize your DHTML control with document.all.divname.style
for example, if you want to start with a hidden layer which shows later on in the page's use, NS is not the best, it will hide once shown, but cannot start invisible, although you could cover it with another layer at a higher z-index...
-Gaspard