möchte folgenden script für meine link seite verwenden..
________________________________________________________
<html>
<head>
<title>explorer like menu</title>
<style type="text/css">
div.sItem{margin-left:10px;cursor:pointer;cursor:hand}
</style>
<script type="text/javascript">
function showSubMenu(e,o) {
// e = event object in W3C DOM compatible browsers (Ex. Mozilla)
// o = div object clicked by user
// Parsing all children of the clicked div
for (i=0;i<o.childNodes.length;i++) {
// Find all div having the CSS class sItem
if (o.childNodes[i].className=="sItem") {
// If the div is hidden, make it visible
if (o.childNodes[i].style.display=="none") {
o.childNodes[i].style.display="block"
} else if (o.childNodes[i].style.display=="block") {
// If the div is visible, hide it
o.childNodes[i].style.display="none"
}
}
}
// Stop click event propagation in upper div hierarchy
if (document.all) {
// Code for IE browsers
window.event.cancelBubble=true
} else if (!document.all && document.getElementById) {
// Code for Mozilla browsers
e.stopPropagation()
}
}
</script>
</head>
<body>
<div class="sItem" style="display:block" onclick="showSubMenu(event,this)">
ordner1
<div class="sItem" style="display:none" onclick="showSubMenu(event,this)">
datei
</div>
</div>
<div class="sItem" style="display:block" onclick="showSubMenu(event,this)">
ordner2
<div class="sItem" style="display:none" onclick="showSubMenu(event,this)">
datei
</div>
</div>
<div class="sItem" style="display:block" onclick="showSubMenu(event,this)">
ordner3
<div class="sItem" style="display:none" onclick="showSubMenu(event,this)">
datei
</div>
</div>
</body>
</html>
_________________________________________________________________________________
wie muss man den script abändern, dass nur ein ordenerinhalt aufs mal angezeigt werden kann (d.h. wird zum bsp bei geöffnetem ordner1 ordner2 angeklickt schliesst sich ordner 1 automatisch wieder).
dürfte wohl nicht allzu schwierig sein für jemand der sich dieser sprache mächtig ist :) danke für jede antwort.
gruss christian