• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

hilfe bei bug im ie, bitte!!!

hardie82

New member
hi leute...ich hab ein total verhextes problem...ich habe mir ein drop-down-menü gebastel, das im firefox wunderbar funktioniert, nur im ie probleme bereitet...aber schaut es euch selber an: http://home.fhtw-berlin.de/~s0505459/test/menutest.php.

so, hier folgt der code für die php, css und js:

main-php:

PHP:
<html>
	<head>
		<link href='test.css' rel='stylesheet' type='text/css'>
	</head>
	<body id="body">
		<div id='menu'>
			<?php
				require 'menu.php';
			?>
		</div>
	</body>
</html>

menu-php:

PHP:
<script type="text/javascript" src="menue.js"></script>

<?php 
	$menuPunkte = array('Ich', 'Und', 'Du', 'Müllers',
											'Kuh', 'Home');
	$unterPunkte = array('Ich' => array('oder', 'jemand', 'Anderes'),
											 'Und' => array('oder', 'Oder'),
											 'Du' => array('oder', 'Er/Sie/Es'),
											 'Müllers' => array('oder', 'Schulzes'),
											 'Kuh' => array('oder', 'Esel'),
											 'Home' => array('oder', 'woanders', 'hin')
											 );
?>

<table id='menubar'>
	<tr id='tr'>
<?php
	for ($i = 0; $i < sizeof($menuPunkte).length; $i++)
		{
			print "	<td id='nav".($i + 1)."' style='padding-right:10px'>
								<li>
									<a href='#'>$menuPunkte[$i]</a>";
			if(sizeof($unterPunkte[$menuPunkte[$i]]) > 0)
			{
				print"<ul>";
				for ($j = 0; $j < sizeof($unterPunkte[$menuPunkte[$i]]); $j++)
				{
					$bezeichnung = $unterPunkte[$menuPunkte[$i]][$j];
					$link = $unterLinks[$menuPunkte[$i]][$j];
					print "<li><a href='#'>$bezeichnung</a></li>";
				}
				print "</ul>";
			}
			print "</li>
					 </td>";
		}	
?>
	</tr>
</table>

css-file:

Code:
@media screen
{
    body {
      margin: 0px;
    }
    a {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 11px;
      font-style: normal;
      line-height: 15px;
      font-weight: normal;
      color: #C71444;
    }
    #body {
      width: 800px;
      background: #CCCCCC;
    }    
		#menu 
		{
		  width: 800px;
		  float: left;
		  border-top-style: solid;
		  border-top-width: 1px;
		  border-bottom-style: solid;
		  border-bottom-width: 1px;
		  border-color: black;
		}
		   
		#menubar ul 
		{
			margin: 0;
			padding: 0;
			list-style: none;
			width: 100px;
		}
		
		#menubar td li  a
		{
			text-decoration:none;
			color: #000000;
			font-weight: bold;
		}
		
		#menubar td li
		{
			list-style: none;
		}
		#menubar ul li 
		{
			position: relative;
		}
		
		#menubar li ul 
		{
			background-color: #CCCCCC;
			position: absolute;
			top: 22px;
			display: none;
		}
		
		#menubar ul li a 
		{
			display: block;
			text-decoration:none;
			font-weight: normal;
			color: #FFFFFF;
			background-color: #999999;
			border: 1px solid #000000;
		}    
		
		#menubar li:hover ul, #menubar li.over ul 
		{ 
			display: block; 
		}
		
		/* Fix IE. Hide from IE Mac \*/
		* html #menubar td li { float: left;}
		* html #menubar ul li a { height: 1%; }
		/* End */
}

und zu guter letzt js-file:

Code:
startList = function() 
{
	if (document.all && document.getElementById)
	{
		for (j = 1; j <= document.getElementById("tr").childNodes.length; j++)
		{
			navRoot = document.getElementById("nav" + j);
			for (i = 0; i < navRoot.childNodes.length; i++) 
			{
				node = navRoot.childNodes[i];
				if (node.nodeName == "LI")
				{
					node.onmouseover = function()	{ this.className += " over";}
	  			node.onmouseout = function() { this.className = this.className.replace(" over", ""); }
	   		}
	  	}
		}
 	}
}
window.onload = startList;

vielleicht kennt ja jemand von euch das problem und kann mir auf anhieb helfen...oder jemand hat ne idee, die das problem beseitigen könnte. ich hab mir daran schon die zähne ausgebissen und nix hat bis jetzt funktioniert. ihr seid meine letzte hoffnung... :whacky:
 
Zurück
Oben