Simon: Klappmenü

Beitrag lesen

Wahrscheinlich stell ich mich gerade furchtbar blöd an.
Dass hab ich bis jetzt, (Frameset linke seite) Die Links sind im Frameset alle offen, wie muss ich jetzt was einbinden? Tut mir Leid für die blöde Fragestellung.

<script>
 function stopBubble(e) {
  if (!e) var e = window.event;
  e.cancelBubble = true;
  if (e.stopPropagation) e.stopPropagation();
 }

function showLink(e, ALink) {
  window.open(ALink, "helpView");
  stopBubble(e);
 }
 function showLink2(t, e) {
  window.open(t.attributes['mylink'].value, "helpView");
  stopBubble(e);
 }

function doExpandCollapse() {
  if (! this.parentNode.myCollapse){
   for (i=0; i < this.parentNode.childNodes.length; i++) {
    cn=this.parentNode.childNodes[i];
    if (cn.tagName == "DIV") {
     cn.style.visibility = "hidden";
     cn.style.height = "0px";
    }
    if (cn.tagName == "IMG") {
     cn.src = "../mmicons/folder_closed.gif";
    }
   }
   this.parentNode.myCollapse = true;
  } else {
   for (i=0; i < this.parentNode.childNodes.length; i++) {
    cn=this.parentNode.childNodes[i];
    if (cn.tagName == "DIV") {
     cn.style.visibility = "";
     cn.style.height = "";
    }
    if (cn.tagName == "IMG") {
     cn.src = "../mmicons/folder_open.gif";
    }
   }
   this.parentNode.myCollapse = false;
  }
 }

function prepareMenu() {
  d = document.getElementsByTagName("DIV");
  for(i = 0; i < d.length; i++) {
   if (d[i].className == "knoten") {
    for (j = 0; j < d[i].childNodes.length; j++) {
     cn = d[i].childNodes[j];
     if (cn && cn.tagName == "IMG") {
      cn.src = "../mmicons/folder_open.gif";
      cn.onclick = doExpandCollapse;
     }
    }
   }
  }
  d = null;
 }

function highLightLink(ALink) {
  d = document.getElementsByTagName("DIV");
  for(i = 0; i < d.length; i++) {
   mylink = d[i].attributes['mylink'];
   if (mylink) {
    if (mylink.value == ALink) {
     d[i].className += " current"
    } else {
     d[i].className = d[i].className.split(" ")[0];
    }
   }
  }
  d=null;
 }

onload = prepareMenu;
 </script>
 <div class="knoten" onclick="showLink2(this, event);" mylink="1.htm"><img src="../mmicons/folder_closed.gif" onclick="doExpandCollapse(this,event)" />1. Allgemeines
  <div class="blatt" onclick="showLink2(this, event);" mylink="1-1.htm">1.1. Programm-Module</div>
  <div class="blatt" onclick="showLink2(this, event);" mylink="1-2.htm">1.2. Erste Schritte</div>
 </div>
 <div class="knoten" onclick="showLink2(this, event);" mylink="2.htm"><img src="../mmicons/folder_closed.gif" />2. Grundmodul
  <div class="knoten" onclick="showLink2(this, event);" mylink="2-1.htm"><img src="../mmicons/folder_closed.gif" />2.1. Stammdaten
   <div class="blatt" onclick="showLink2(this, event);" mylink="2-1-1.htm">2.1.1. Firmen-Daten</div>
   <div class="blatt" onclick="showLink2(this, event);" mylink="2-1-2.htm">2.1.2. Feiertage</div>
   <div class="knoten" onclick="showLink2(this, event);" mylink="2-1-3.htm"><img src="../mmicons/folder_closed.gif" />2.1.3. Tarifzeiten
    <div class="blatt" onclick="showLink2(this, event);" mylink="2-1-3-1.htm">2.1.3.1. WochenTarifzeiten</div>
   </div>
..