menü will nicht so ganz! ;-)

Samuel

Erfahrenes Mitglied
das problem ist das ich will das das untermenü ausgeblendet wird wenn ich mit der maus aus dem untermenü rausfahre
leider blendet er mir das menü schon aus wenn ich aus einer td in die andere fahre

keine ahnung wo der fehler liegt! ist es überhaupt möglich onmouseover einem table-tag zuzuweisen?

bitte um hilfe! danke im voraus
hier mal der code:
Code:
<html> 
<head> 
   <title>Untitled</title> 
   <script language="JavaScript"> 
   var menues = new Array("menue01", "menue02", "menue03"); 
   var d = document; 
   function showMenue(divName) {  
     if(d.layers) { 
       for(var i = 0; i < menues.length; i++) { 
        if(menues[i] == divName) { 
          d.layers[menues[i]].visibility = "show"; 
        } else { 
          d.layers[menues[i]].visibility = "hide"; 
        } 
      } 
     } else if(d.all) { 
       for(var i = 0; i < menues.length; i++) { 
        if(menues[i] == divName) { 
          d.all[menues[i]].style.visibility = "visible"; 
        } else { 
          d.all[menues[i]].style.visibility = "hidden"; 
        } 
      } 
     } else if((!d.all)&&(d.getElementById)) { 
       for(var i = 0; i < menues.length; i++) { 
        if(menues[i] == divName) { 
          d.getElementById(menues[i]).style.visibility = "visible"; 
        } else { 
          d.getElementById(menues[i]).style.visibility = "hidden"; 
        } 
      } 
     } 
   } 
   function hideDiv(divName) { 
     if(d.layers) { 
      d.layers[divName].visibility = "hide"; 
    } else if(d.all) { 
      d.all[divName].style.visibility = "hidden"; 
    } else if((!d.all)&&(d.getElementById)) { 
      d.getElementById(divName).style.visibility = "hidden"; 
    } 
   } 
   </script> 
</head> 

<body> 
<table cellpadding=0 cellspacing=0 border=0 width=600 bgcolor="#000000"> 
  <tr> 
    <td> 
   <table cellpadding=2 cellspacing=1 border=0 width=600> 
     <tr> 
       <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080'; showMenue('menue01');" onmouseout="this.bgColor='#c0c0c0'">Menue 1</td> 
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080'; showMenue('menue02');" onmouseout="this.bgColor='#c0c0c0'">Menue 2</td> 
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080'; showMenue('menue03');" onmouseout="this.bgColor='#c0c0c0'">Menue 3</td> 
     </tr> 
   </table> 
   </td> 
  </tr> 
</table> 
<!--Menüs--> 
<div id="menue01" style="position:absolute; top:39px; left:10px; width:200px; height:100px; background-Color:#CCCCCC; visibility:hidden;" onmouseout="hideDiv('menue01')"> 
<table cellpadding=0 cellspacing=0 border=0 width=200 bgcolor="#000000"> 
  <tr> 
    <td> 
   <table cellpadding=2 cellspacing=1 border=0 width=200> 
     <tr> 
       <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 1.1</td> 
     </tr> 
     <tr>    
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 1.2</td> 
     </tr> 
     <tr>    
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 1.3</td> 
     </tr> 
   </table> 
   </td> 
  </tr> 
</table> 
</div> 
<div id="menue02" style="position:absolute; top:39px; left:210px; width:200px; height:100px; background-Color:#CCCCCC; visibility:hidden;" onmouseout="hideDiv('menue02')"> 
<table cellpadding=0 cellspacing=0 border=0 width=200 bgcolor="#000000"> 
  <tr> 
    <td> 
   <table cellpadding=2 cellspacing=1 border=0 width=200> 
     <tr> 
       <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 2.1</td> 
     </tr> 
     <tr>    
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 2.2</td> 
     </tr> 
     <tr>    
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 2.3</td> 
     </tr> 
   </table> 
   </td> 
  </tr> 
</table> 
</div> 
<div id="menue03" style="position:absolute; top:39px; left:410px; width:200px; height:100px; background-Color:#CCCCCC; visibility:hidden;" onmouseout="hideDiv('menue03')"> 
<table cellpadding=0 cellspacing=0 border=0 width=200 bgcolor="#000000"> 
  <tr> 
    <td> 
   <table cellpadding=2 cellspacing=1 border=0 width=200> 
     <tr> 
       <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 3.1</td> 
     </tr> 
     <tr>    
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 3.2</td> 
     </tr> 
     <tr>    
      <td bgcolor="#c0c0c0" width=200 onmouseover="this.bgColor='#808080';" onmouseout="this.bgColor='#c0c0c0'">Menue 3.3</td> 
     </tr> 
   </table> 
   </td> 
  </tr> 
</table> 
</div> 
<!--Menüs Ende--> 
</body> 
</html>

danke im voraus
greetZZzz
 
wenn du vor hast ein richtig stabiles menu zu bauen rate ich dir an das ganze mit layern zu lösen.

Ich habe auch schon zwei solche menus programmiert, du kannst dir ja mal den code anschauen...

http://endlessx.com/scripts/dlmenu/dlmenu.html (mein neues Menu, funktioniert in allen DOM Browsern, ansonsten wird eine Liste mit den Links dargestellt)

http://endlessx.com/scripts/Bigmenu/menutop.html (mein alter Menu-Script, viel grösser... funktioniert in IE4+ NN4+ Moz Opera5+)
 
danke danke

danke für deine antwort ich seh mir jetzt mal deine menüs an und falls ich fragen habe meld ich mich wieder

hab den source noch nicht angesehn aber vom optischen her gefallen mir die menüs sehr gut.

übrigens deine homepage http://www.endlessx.com ist wirklich gut gelungen!


thX 'n' greetZZzz :)
 

Neue Beiträge

Zurück