I have the following bit of code. Around line 20 is the code I am using to 'unhide' various tables based upon a drop down selection. The problem I am running into is the tables are overlapping each other (they're all set to appear at the same fixed spot) so after I select the last option in the drop down, I can't see the upper selection's tables anymore. Make sense? I need a snippet of code, probably inserted above line 22 that will reset the visibility to default (hidden) prior to revealing the currently selected options table. Is this something I could have some assistance with?
Thanks.
Thanks.
Code:
<html>
<head>
<style>
body{font-family:arial;}
table{font-size:80%;background:lightgreen}
a{color:black;text-decoration:none;font:bold}
a:hover{color:#606060}
td.menu{background:lightblue}
table.menu
{
font-size:100%;
position:fixed;
left:20px;
top:50px;
visibility:hidden;
}
</style>
<script type="text/javascript">
function showmenu()
{
y=document.forms[0].list.value;
document.getElementById(y).style.visibility="visible";
}
</script>
</head>
<body>
<form>
<select id="list" onchange="showmenu()">
<option value="nada"> --select a field--
<option value="plants">Plants, hydro, etc.
<option value="fish">Trout Fishing
<option value="cpu">Networking, Internet, Linux whatnot
</select>
</form>
<table class="menu" ID="plants" width=35%">
<th>Plants, Hydro, etc.</th>
<tr>
<td><a href="http://southerexposure.com/index.html">Southern Exposure Seed Exchange</a></td></tr>
<tr>
<td><a href="http://www.groworganic.com">Strawberry Bareroot Supplier</a></td></tr>
</table>
<table class="menu" ID="fish" width=35%">
<th>Stuff About Fishing</th>
<tr>
<td><a href="http://www.ncwrc.org">NC Wildlife Resources Commision</a></td></tr>
<tr>
<td><a href="http://www.digital-topo-maps.com">Topo Maps</a></td></tr>
</table>
<table class="menu" ID="cpu" width=35%">
<th>Computer, Linux, Whatnot. . . </th>
<tr>
<td><a href="http://www.aboutdebian.com">About Debian</a></td></tr>
<tr>
<td><a href="http://www.newegg.com">New Egg</a></td></tr>
</table>
</body>
</html>
Comment