Click to See Complete Forum and Search --> : layer in netscape??
lychew
Dec 6th, 2000, 05:29 AM
Anybody know how to hide a layer and display a layer in netscape?
I need to us the <div> tag instead of the <layer> tag.
I used document.all.layername.visibility="hidden" and it works in IE.
But when i use document.layers.layername.visibility="hidden", netscape give me no property error.
Anybody have any idea?
Mark Sreeves
Dec 6th, 2000, 06:02 AM
try this:
document.object2.visibility = 'hidden';
and the layer is defined thus:
<div ID="object2" STYLE="position:absolute;top:145;left:270">
</div>
lychew
Dec 6th, 2000, 07:17 AM
This doesn't work in Netscape.
my Structure:
<body onload="hideLayer()">
<table>
<tr><td>
<div name=test id=test>
<table>
</table>
</div>
</td>
</tr>
</table>
</body>
function hideLayer() {
if (document.layers) {
document.test.visibility="hidden";
}
else if (document.all) {
document.all["test"].style.visibility="hidden";
}
}
IE is working, netscape is not. Anybody has a solution?
Mark Sreeves
Dec 6th, 2000, 09:53 AM
it seems that you DIV needs to have some style attibutes defined.
also, defining DIVs within a table id a bit er... unusual.
this works:
<HTML>
<HEAD>
<Script language=javascript>
function hideLayer()
{
if(document.layers)
{
document.obj1.visibility="hidden";
}
else if (document.all)
{
document.all["obj1"].style.visibility="hidden";
}
}
</script>
</HEAD>
<body onLoad="hideLayer()">
<div id='obj1' STYLE="position:absolute;top:145;left:270">
some text
</div>
</body>
</HTML>
lychew
Dec 6th, 2000, 07:16 PM
You are right.
My problem is the table.
If i put the <div> as below:
<table>
<tr><td><table>
<div><tr><td><table><tr><td>testing</td></tr></table></td></tr></div>
</table></td></tr>
</table>
It works in IE but not netscape. If i put it opposite:
<table>
<tr><td>
<div>
<table>
<tr><td><table><tr><td>testing</td></tr></table></td></tr>
</table></div></td></tr>
</table>
It totally will not work.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.