Forum Moderators: open

Message Too Old, No Replies

show/hide layers problem

         

rdruser

9:10 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



I am trying to use the show/hide layer technique but am having problems. It loads fine and doesn't give me any syntax errors, but when I click the links that are suppose to hide the old layer and show the new layer, it hides the first, but doesn't show the next.

Here's what I'm using...

<script type="text/javascript">
function displaylyr1(){
nolyr2();
nolyr3();
lyr1.style.visibility='visible';
}
function displaylyr2(){
nolyr1();
nolyr3();
lyr2.style.visibility='visible';
}
function displaylyr3(){
nolyr1();
nolyr2();
lyr3.style.visibility='visible';
}
function nolyr1(){
lyr1.style.visibility='hidden';
}
function nolyr2(){
lyr2.style.visibility='hidden';
}
function nolyr3(){
lyr3.style.visibility='hidden';
}
</script>

<div style="display;" id="lyr1">
<p align="center">
<img border="0" src="../../10387367.gif" width="120" height="60"></p>
</div>

<div style="display: none;" id="lyr2">
<p align="center">
<img border="0" src="../../10387367.gif" width="120" height="60"></p>
</div>

<div style="display: none;" id="lyr3">
<p align="center">
<img border="0" src="../../10387367.gif" width="120" height="60"></p>
</div>

</TD>
</TR>
<TR>
<TD width="98" height="14" bgcolor="#EAEAEA">
<p align="center"><font size="1" face="Verdana">
<a style="text-decoration: none" href="javascript:displaylyr2();void(0);">Description</a></font></TD>
<TD>
<IMG SRC="images/progress-more_10.gif" WIDTH=1 HEIGHT=14 ALT=""></TD>
<TD COLSPAN=3 bgcolor="#797979">
<p align="center"><font size="1" color="#FFFFFF" face="Verdana">
<a href="javascript:displaylyr3()">Requirements</a></font></TD>

Any help or suggestions would be appreciated!

Bernard Marx

10:37 pm on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have the divs initially hidden using the display property, but the script is toggling the visibility property.