File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes NetScape 6 show/hide Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "NetScape 6 show/hide" Watch "NetScape 6 show/hide" New topic

NetScape 6 show/hide

j tomaszewski

Joined: Oct 29, 2001
Posts: 3
I develop ASP's but am looking for a JavaScript function that will hide a given section of text/images when the page has completed loading. I use the simple function below but section will not "hide" in NN 6.
function NSdisplay(){
document.layer.visibility = "hide";
<body bgcolor="#FFFFFF" text="#000000" onLoad="NSdisplay();">
<LAYER id="layer" name="layer">
<img id=picture height="30" src="../images/test.gif" width="140" border="0"></a>
<table width="90%" border="0" cellspacing="4" cellpadding="0" align="center" height="1">
<tr align="left" valign="top">
<td><b><font id=text face="Verdana, Arial, Helvetica, Sans-Serif" size="3" color="#CC6600">Your
application has been submitted.</font></b><br>
<font id=text2 face="Verdana, Arial, Helvetica, Sans-Serif" size="3" color="#000000"><STRONG>Please wait while we
process your application.</FONT></STRONG>
<p><center><IMG id=picture2 height=10 src="../images/timer.gif" width=43></center>
<hr noshade size="1">
Any ideas??
Thanks ...
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I'd have to look a bit deeper, but initially, don't call it layer since it tuurns up as a reserved word and browsers get confused easily.
Beyond that, you're looking at some fun since the control between EI and NS are very different but you'll need something like this...

Note that I've called the layer "layer0".
If you have more problems, we can cover them point by point here, but I'd recommend a good book and an informative web site. (I like O'Reillys Javascript book)
(and I'm no expert, I'm stealing from a solution someone wrote for me ages back )
[This message has been edited by David O'Meara (edited October 29, 2001).]
j tomaszewski

Joined: Oct 29, 2001
Posts: 3
Thanks for the help Dave.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

Hi Jeff,
Show/Hide won't work with Netscape 6.x, it uses newer DOM model which is not backward compatible with Netscape 4.x.
Here's a cross browser function that'll allow you to show/hide a lyer in most browsers. And yes, as David suggested you need to change name from layer to layer0 or something, and enclose it in a <div>...</div> tag intstead of <layer>...</layer>. Here's the code -

Also have look at this, and see if it is of any help.
- Manish

[This message has been edited by Manish Hatwalne (edited October 29, 2001).]
I agree. Here's the link:
subject: NetScape 6 show/hide
It's not a secret anymore!