DHTML-Navigation mit kleinem Fehler!

Status
Nicht offen für weitere Antworten.

Seven Secrets

Erfahrenes Mitglied
So, jetzt muß ich mal vom php weg gehen und eine Frage stellen, die ich mir absolut nicht selber beantworten kann. Ich habe eine Navigation mit Dropdownmenü erzeugt. Die sieht so aus:

Code:
<CENTER>
<style>
.menu

{
	position: static;
	top: 0;
	z-index: 2;
}
.submenu

{
	position: static;
	top: 19;
	z-index: 0;
	visibility: hide;
	visibility: hidden;
}
</style>
<script>
<!--
var old;
var memold;
var subold;
if(document.layers)
{
	window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown=do_out;
} else
{
	document.onmousedown=do_out;
}
function show_layer(x)
{
	if(document.layers)
		document.layers[x].visibility="show";
	else
		document.all[x].style.visibility="visible";
}
function hide_layer(x)
{
	if(document.layers)
		document.layers[x].visibility="hide";
	else
		document.all[x].style.visibility="hidden";
}
function do_menu(x)
{
	if(!old)
		old=memold;
	if(old!=x)
	{
		show_layer(x);
		old=x;
	} else
		old="";
}
function do_check(x)
{
	if(old && old!=x)
	{
		hide_layer(old);
		show_layer(x);
		old=x;
	}
	do_submenu();
}
function do_out()
{
	if(old)
		hide_layer(old);
	memold=old; old="";
	do_submenu();
}
function do_submenu(x)
{
	if(subold)
	{
		hide_layer(subold);
		subold="";
	}
	if(x)
	{
		show_layer(x);
		subold=x;
	}
}
// -->
</script>
  <table border="0" cellspacing="0" cellpadding="0">
    <tr valign="top"> 
      <td> 
        <table width="45" height="19" border="0" cellpadding="0" cellspacing="0" style="background-image:url(grafik/bg-navi.jpg); filter:Alpha(opacity=75, finishopacity=0, style=0)">
  		<tr class="navigate"> 
    		<td><a href="home.php" target="screen">Home</a></td>
  		</tr>
  </table>
</td>
<td> 
  <div id="m1" class="menu" style="left: 5;"> 
    <table width="90" height="19" border="0" cellpadding="0" cellspacing="0" style="background-image:url(grafik/bg-navi.jpg); filter:Alpha(opacity=75, finishopacity=0, style=0)">
      <tr class="navigate"> 
        <td><a href="javascript:do_menu('m1x')" onmouseover="do_check('m1x')"><b>Unternehmen</b></a> 
        </td>
      </tr>
    </table>
  </div>	
  <div id="m1x" class="submenu" style="left: 5;"> 
    <table width="90" height="65" border="0" cellpadding="0" cellspacing="0" style="background-color:#6699FF">
      <tr class="navigate"> 
              <td align="left"><a href="portrait.php" target="screen">&nbsp;- Portrait</a><br> <a href="home.php" target="screen">&nbsp;- Qualifikation</a><br> <a href="home.php" target="screen">&nbsp;- Mitarbeiter</a><br> 
          <a href="home.php" target="screen">&nbsp;- Über uns</a></td>
      </tr>
    </table>
  </div>
</td>
<td> 
  <div id="m1" class="menu" style="left: 93;"> 
          <table width="342" height="19" border="0" cellpadding="0" cellspacing="0" style="background-image:url(grafik/bg-navi.jpg); filter:Alpha(opacity=75, finishopacity=0, style=0)">
            <tr class="navigate"> 
        <td width="78"><a href="home.php" target="screen">Fachgebiete</a></td>
        <td width="58"><a href="home.php" target="screen">Projekte</a></td>
        <td width="72"><a href="home.php" target="screen">Download</a></td>
        <td width="57"><a href="kontakt.php" target="screen">Kontakt</a></td>
        <td width="77"><a href="impressum.php" target="screen">Impressum</a></td>
      </tr>
    </table>
  </div>	
</td>
</tr>
</table>
</center>

Das läuft auch hervorragend, nur das die Links für Potrait, Qualifikation, Mitarbeiter und Über uns nicht laufen wollen. Wo ist hier der Fehler?
 
Hi,

ändere mal im oberen Teil von deinem Javascript alle MouseDown in MouseUp, da wird erst der Link gewählt und dann die Navi geschlossen.

Code:
if(document.layers)
{
	window.captureEvents(Event.MOUSEUP);
	window.onmouseup=do_out;
} else
{
	document.onmouseup=do_out;
}

Gruß
 
Status
Nicht offen für weitere Antworten.
Zurück