Ik heb ooit zo'n script gemaakt. Het werkt zoals die van jou en er zit ook een extra optie op: dat je maar één menu tegelijkertijd open kunt hebben. Getest en werkt in Internet Explorer 6, FireFox 1.5 en Opera 8.5

Kijk maar even op deze pagina of het is wat je bedoelt.
ja wel zo ongeveer.
maar dan meer in de vorm van die ik nu had.
kan ik die kleuren nader hand nog bijstellen?
Ja, das gewoon de stijl aanpassen, dat heeft niets met het JavaScript te maken. Het is een script dat ik al een paar jaar geleden heb gemaakt en een aantal dingen zou ik nu iets anders doen, maar het werkt nog steeds in de drie belangrijkste browsers. Dit is de code:

<html>
<head>
<title>:::::: KOEHOORN IT - CASE STUDIES ::::::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<base target="frameMain">

<style type="text/css">
@import url(inc/stylesheet.css);
</style>

<script language="JavaScript" type="text/javascript">
function handleMenu (theMenu)
{
var i;
var allTRs = tableMenu.getElementsByTagName ("tr");

for (i = 0; i < allTRs.length; i++)
{
if (allTRs[i].id.indexOf (theMenu) != -1)
{
if (allTRs[i].style.display == 'none')
allTRs[i].style.display = '';
else
allTRs[i].style.display = 'none';
}
else if (allTRs[i].id.indexOf ('menu') == -1 && document.getElementById ('eenMenu').checked)
{
allTRs[i].style.display = 'none';
}
}
}
</script>

</head>

<body bgcolor="#DDDDDD">
<table width="100%" border="0" cellspacing="0" cellpadding="4" id="tableMenu">

<tr id="menu0">
<td bgcolor="#666666"><strong><font color="#FFFFFF">KOEHOORN-IT<br>
CASE STUDIES</font></strong></td>
</tr>
<tr id="menu1" onClick="handleMenu ('htmlCss')" style="cursor: hand">
<td bgcolor="#00CCFF">HTML/CSS</td>
</tr>
<tr id="htmlCss1" style="display: show">
<td><a href="visitedlinks/index.html">Filtering visited image-links</a></td>

</tr>
<tr id="htmlCss2" style="display: show">
<td><a href="iframes/index.html">Switching iframe contents</a></td>
</tr>
<tr id="htmlCss3" style="display: show">
<td><a href="csstable/index.html">Coloring table borders</a></td>
</tr>
<tr id="menu2" onClick="handleMenu ('dhtml')" style="cursor: hand">
<td bgcolor="#FF33CC">DHTML</td>

</tr>
<tr id="dhtml1" style="display: none">
<td><a href="crossbrowserdom/index.php">Cross browser visibility and display</a></td>
</tr>
<tr id="dhtml2" style="display: none">
<td><a href="multipleid/index.htm">Multiple ID visibility test</a></td>
</tr>
<tr id="dhtml3" style="display: none">
<td><a href="autoform/autoform.html">Auto form checker</a></td>

</tr>
<tr id="menu3" onClick="handleMenu ('php')" style="cursor: hand">
<td bgcolor="#99FF00">PHP</td>
</tr>
<tr id="php1" style="display: none">
<td><a href="checkbox/checkbox.php">Catching checkbox info via post</a></td>
</tr>
<tr id="php2" style="display: none">
<td><a href="upload/index.php">File uploads</a></td>

</tr>
<tr id="php3" style="display: none">
<td><a href="framelogin/index.php">Login to framespage</a></td>
</tr>
<tr id="php4" style="display: none">
<td><a href="poll/index.php">Poll</a></td>
</tr>
<tr id="php5" style="display: none">
<td><a href="search/index.php">Search</a></td>

</tr>
<tr id="php5" style="display: none">
<td><a href="shout/index.php">Shout</a></td>
</tr>
<tr id="php6" style="display: none">
<td><a href="statistics/index.php">Statistics</a></td>
</tr>
<tr id="php7" style="display: none">
<td><a href="updatetext/index.php">Update tekst</a></td>

</tr>
<tr id="php8" style="display: none">
<td><a href="subscribe/index.php">Subscribing</a></td>
</tr>
<tr id="php9" style="display: none">
<td><a href="multiform/index.php">Multiform</a></td>
</tr>
<tr id="php10" style="display: none">
<td><a href="htmlmail/htmlmail.php">HTML Mail Editor</a></td>

</tr>
<tr id="menu4" onClick="handleMenu ('javascript')" style="cursor: hand">
<td bgcolor="#FFFF66">JAVASCRIPT</td>
</tr>
<tr id="javascript1" style="display: none">
<td><a href="tablesort/index.html">Table sort</a></td>
</tr>
<tr id="javascript2" style="display: none">
<td><a href="textarea/index.html">Textarea handlers</a></td>

</tr>
<tr id="menu5" onClick="handleMenu ('flash')" style="cursor: hand">
<td bgcolor="#CC99CC">FLASH ACTIONSCRIPT</td>
</tr>
<tr id="flash1" style="display: none">
<td><a href="flashdyntext/index.html">Dynamically loading text</a></td>
</tr>
<tr id="flash2" style="display: none">
<td><a href="flashdyntext/index2.html">Dynamically loading text - 2</a></td>

</tr>
<tr id="flash2" style="display: none">
<td><a href="flashloadmov/movie1.html">Dynamically loading swf's</a></td>
</tr>
<tr id="flash2" style="display: none">
<td><a href="preloader/preloader.html">Preloader 1</a></td>
</tr>
<tr id="flash2" style="display: none">
<td><a href="preloader2/preloader.html">Preloader 2</a></td>

</tr>
<tr id="flash2" style="display: none">
<td><a href="flashshout/index.php">Shout in flash</a></td>
</tr>
<tr id="flash2" style="display: none">
<td><a href="flashsound/index.php">Sound controlling</a></td>
</tr>
<tr id="menu6">
<td bgcolor="#666666">
<input name="eenMenu" type="checkbox" id="eenMenu" value="eenMenuTegelijk" checked>

<font color="#FFFFFF">Slechts &eacute;en menu tegelijkertijd open</font></td>
</tr>
</table>

</body>
</html>
oke bedankt.
maar wat ik had is dat moelijk te maken omdat ik dat wat makkelijker vond kijken in frontpage

Reageren