Show layer content
Hide layer content
This is a layer called "layer1"
This script demonstrates how to show/hide layers with javascript/dhtml. (note: if you use topmargin, marginwidth, etc. it will screw up the scrollbars in netscape 4.7 when you have layers.)
Source for showhide.html
<html>
<head>
<title></title>
</head>
<body bgcolor=white text=black>
<SCRIPT LANGUAGE="JAVASCRIPT">
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
var n6 = (!document.all && document.getElementById) ? 1:0;
function show() {
if (n6) document.getElementById("layer1").style.visibility = "visible";
else if (n) document.layer1.visibility = "show";
else if (ie) layer1.style.visibility = "visible";
}
function hide() {
if (n6) document.getElementById("layer1").style.visibility = "hidden";
else if (n) document.layer1.visibility = "hide";
else if (ie) layer1.style.visibility = "hidden";
}
</SCRIPT>
<A HREF="#" onClick="show()">Show layer content</A><BR>
<A HREF="#" onClick="hide()">Hide layer content</A><BR>
<DIV ID="layer1" STYLE="position:absolute; top:100; left:100; visibility:visible">
This is a layer called "layer1"<BR>
</DIV>
</body>
</html>