I have the following function to show and hide two layers:
I cant get layer B to work, using one function. I think i have to pass the function a generic argument?
Any help would be appreciated. Here is the code:
I cant get layer B to work, using one function. I think i have to pass the function a generic argument?
Any help would be appreciated. Here is the code:
Code:
<html>
<head>
<SCRIPT language=JavaScript><!--
function showIt(layerA)
{
if(document.layers)
document.layers["layerA"].visibility="visible";
if(document.all)
document.all["layerA"].style.visibility="visible";
}
function hideIt(layerA)
{
if(document.layers)
document.layers["layerA"].visibility="hidden";
if(document.all)
document.all["layerA"].style.visibility="hidden";
}
// -->
</SCRIPT>
<STYLE type=text/css>
#layerA {
BACKGROUND-COLOR: #FFFFFF; LEFT: 10px; POSITION: absolute; TOP: 50px; VISIBILITY: hidden; WIDTH: 300px
}
#layerB {
BACKGROUND-COLOR: #FFFFFF; LEFT: 10px; POSITION: absolute; TOP: 80px; VISIBILITY: hidden; WIDTH: 300px
}
</STYLE>
</head>
<body>
<A href="#" onmouseout=hideIt(layerA); onmouseover=showIt(layerA);>Link A</a>
<A href="#" onmouseout=hideIt(layerB); onmouseover=showIt(layerB);>Link B</a>
<DIV class=text id=layerA>AAAAAAAA</DIV>
<DIV class=text id=layerB>BBBBBBBB</DIV>
</body>
</html>