-
Hi Aniz,
Here is a simple example of how u can hide/show layers in NS,
This wrote the code in a hurry , so it might contain errors, i will post a better version of the code when i get home from work in few hours.
Hope this helps
Code:
<html>
<head>
<script>
function testit()
{
var vis;
vis=document.layers["test"].visibility;
if (vis=="hide")
{
document.layers["test"].visibility="visible";
document.form1.btn1.value="Hide";
}
else
{
document.layers["test"].visibility="hidden";
document.form1.btn1.value="Show";
}
}
</script>
</head>
<body>
<layer name="test" >
<h1>Test</h1>
</layer>
<br><br><br>
<form name=form1>
<input type =button value="Hide" onclick="javascript:testit()" name=btn1>
</form>
</body>
</html>
-
Hi Aniz,
Here is a simple example of layer which works in IE and Netscape.
Hope this helps
Code:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<TITLE></TITLE>
<script>
var ie4,ns4;
ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 ))
function showlayer(layername)
{
if (ie4)
{
eval("document.all."+layername+".style.visibility='visible'");
}
else
{
document.layers[layername].visibility="visible";
}
}
function hidelayer(layername)
{
if (ie4)
{
eval("document.all."+layername+".style.visibility='hidden'");
}
else
{
document.layers[layername].visibility="hidden";
}
}
</script>
</HEAD>
<BODY bgcolor="#66CCCC">
<div id="info" style="position:absolute; left:283px; top:102px; width:368px; height:79px; z-index:1; background-color: #999999; layer-background-color: #999999; border: 1px none #000000; visibility: hidden"><b>This
is a simple example of Layer which both works in IE and Netscape. This example
uses the DIV tag to define the layers.</b></div>
<div id="Layer2" style="position:absolute; left:283px; top:188px; width:368px; height:46px; z-index:2">
<div align="center">
<h3><a href="#" onmouseOver="javascript:showlayer('info')" onmouseout="javascript:hidelayer('info')" >Show Info </a></h3>
</div>
</div>
<p align="center">
</BODY>
</HTML>
-
Now the poor fellow can live until his next assignment