Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display problem

Status
Not open for further replies.

rajkum

Programmer
Jul 30, 2003
48
0
0
US
Hi,

The HTML below works fine in IE and safari but NOT in Netscape. Netscape does not hide the scrolling panel of the Select box.
Is there any way i can hide it?

I am using Netscape 6.2.1.
Thanks in advance.





<html>
<head>
<title>
TITLE
</title>


<script language="JavaScript">

function showLayer(layerNum)
{

showLayer1(layerNum)

}


function showLayer1(layerNum)
{
if (layerNum ==1)
{
if (document.getElementById)
{
document.getElementById("layer1").style.visibility ='visible';
document.getElementById("layer2").style.visibility ='hidden';


}
else if (document.layers)
{
document.pdis_wrapper.document.layers["layer2"].visibility='hide';
document.pdis_wrapper.document.layers["layer1"].visibility='show';
}
else
{
document.all["layer2"].style.visibility='hidden';
document.all["layer1"].style.visibility='visible';

}

}
else if (layerNum == 2)
{
if (document.getElementById)
{
document.getElementById("layer1").style.visibility ='hidden';
document.getElementById("layer2").style.visibility ='visible';
}
else if (document.layers)
{
document.pdis_wrapper.document.layers["layer2"].visibility='show';
document.pdis_wrapper.document.layers["layer1"].visibility='hide';
}
else
{
document.all["layer2"].style.visibility='visible';
document.all["layer1"].style.visibility='hidden';

}

}

}
</script>
</head>
<body>
<TABLE border = "1"
align ="center"
style ="cell-padding:0">

<TR>
<TD><a href="javascript:showLayer(1)">Layer1</a></TD>
<TD><a href="javascript:showLayer(2)">Layer2</a></TD>
</TR>
</TABLE>

<DIV ID='layer1' style='position:absolute; LEFT:100; TOP:100;'>

<TABLE border = "1"
align ="center"
style ="cell-padding:0">

<TR>
<TD>Name</TD>
<TD>Some Name

<select name="" size="2">

</select>
</TD>
</TR>
</TABLE>
</DIV>


<DIV ID='layer2' style='position:absolute; LEFT:100; TOP:200;'>

<TABLE border = "1"
align ="center"
style ="cell-padding:0">
<TR>
<TH colspan="2">Table 2 </TH>
</TR>

<TR>
<TD>Some other label</TD>
<TD>Etc</TD>
</TR>
</TABLE>
</DIV>


</body>
</html>

 
try the code below. It seems you had a lot of unneccesary code in there...

Code:
<html>
<head>
    <title>
        TITLE
    </title>


<script language="JavaScript">

function showLayer(show, hide) {
	document.getElementById(show).style.visibility = 'visible';
	document.getElementById(hide).style.visibility = 'hidden';
}
</script>
</head>
<body>
<TABLE border="1" align="center" style="cell-padding:0"><TR>    
	<TD><a href="#" onclick="showLayer('layer1', 'layer2'); return false;">Layer1</a></TD>
	<TD><a href="#" onclick="showLayer('layer2', 'layer1'); return false;">Layer2</a></TD>
</TR></TABLE>

<DIV ID='layer1' style='position:absolute; LEFT:100; TOP:100;'>

<TABLE border="1" align="center" style="cell-padding:0"><TR>    
	<TD>Name</TD>
	<TD>Some Name
	<select name="" size="2">
	 </select>
    </TD>
</TR></TABLE>
</DIV>

<DIV ID='layer2' style='position:absolute; LEFT:100; TOP:200;'>

<TABLE border="1" align="center" style="cell-padding:0"><TR>    
	<TH colspan="2">Table 2 </TH>
</TR><TR>    
	<TD>Some other label</TD>
	<TD>Etc</TD>
</TR></TABLE>

</DIV>

</body>
</html>

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Thank you cLFlaVA, but the Netscape problem still persists.
 
what version?

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 

how about this


function showLayer(show, hide)
{
document.getElementById(show).style.display = 'block';
document.getElementById(hide).style.display = 'none';
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top