Menu skal lukkes ved klik igen
Hej jeg har denne menu-kode.. Når man klikker på menu-punket "hopper" underpunkterne nede under.. Dette virker men hvordan laver så at menupunkt1 (med underpunkter) lukker når man klikker på menupunkt2:<html>
<head>
<script language="JavaScript">
function showOptions(id) {
var styleCheck = document.getElementById("show" + id).style.display;
if (styleCheck == "inline") {
document.getElementById("show" + id).style.display = "none";
}
if (styleCheck == "none") {
document.getElementById("show" + id).style.display = "inline";
}
}
</script>
</head>
<body>
<a href=""><img src="menuknap.gif" height="10" width="100" border="0"></a>
<br>
<div align="center" style="Cursor:Hand;" OnClick="showOptions(1);"><strong>Vis / skjul</strong></div>
<div style="display: none;" id="show1">
<!-- Denne table skal komme frem over billede -->
<table border="0" width="150" cellspacing="3" cellpadding="3" bgcolor="#000000">
<tr><td bgcolor="#586E7A">
<a href=" class="menu"> link 1</a><br>
<a href=" class="menu"> link 2</a><br>
<a href=" class="menu"> link 3</a><br>
<a href=" class="menu"> link 4</a><br>
<a href=" class="menu"> link 5</a><br>
</td></tr></table>
</div>
sdsadas
<a href=""><img src="menuknap.gif" height="10" width="100" border="0"></a>
<br>
<div align="center" style="Cursor:Hand;" OnClick="showOptions(2);"><strong>Vis / skjul</strong></div>
<div style="display: none;" id="show2">
<!-- Denne table skal komme frem over billede -->
<table border="0" width="150" cellspacing="3" cellpadding="3" bgcolor="#000000">
<tr><td bgcolor="#586E7A">
<a href=" class="menu"> link 1</a><br>
<a href=" class="menu"> link 2</a><br>
<a href=" class="menu"> link 3</a><br>
<a href=" class="menu"> link 4</a><br>
<a href=" class="menu"> link 5</a><br>
</td></tr></table>
</div>
ææææ
</body>
</html>
