Det er okay - eksemplet var vist lidt for enkelt i forhold til hvad jeg ville lave, men dit eksempel virkede, så du får pointene :-)
Hele eksemplet ser sådan ud:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd"><html>
<head>
<title>menu_test</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<style type="text/css">
#navigation {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-style: normal;
font-weight: normal;
color: white;
background-color:blue;
width:171px;
padding-top:10px;
padding-bottom:10px;
text-align: left;
cursor:pointer;
}
#navigation div {
width:161px;
padding-top:5px;
padding-bottom:5px;
margin-left:10px;
}
#navigation a {
text-decoration:none;
color:white;
cursor:hand;
}
#navigation .hidden {
display:none;
}
#navigation .visible {
display:block;
}
#navigation .active {
background-color:green;
}
#navigation .inactive {
background-color:blue;
}
#navigation #submenu {
background-color:blue;
width:171px;
position:absolute;
left:168px;
border:1px solid black;
}
#navigation .nested {
background-image:url('arrow.gif');
background-position:right;
background-repeat:no-repeat;
}
</style>
<script type="text/javascript">
function showChildren(node) {
var subnodes = node.getElementsByTagName('div');
if(subnodes.length > 0 && node.href == null)
node.className = "active nested";
else
node.className = "active";
for(i = 0; i < subnodes.length; i++) {
subnodes[i].className = "visible";
}
}
function hideChildren(node) {
var subnodes = node.getElementsByTagName('div');
if(subnodes.length > 0 && node.href == null)
node.className = "inactive nested";
else
node.className = "inactive";
for(i = 0; i < subnodes.length; i++) {
subnodes[i].className = "hidden";
}
}
</script>
</head>
<body>
<div id="navigation">
<div onMouseOver="showChildren(this)" onMouseOut="hideChildren(this)" class="nested">Parent
<div id="submenu" class="visible">
<div onMouseOver="showChildren(this)" onMouseOut="hideChildren(this)" class=""><a href="#">Child 1.1</div></a>
<div onMouseOver="showChildren(this)" onMouseOut="hideChildren(this)" class=""><a href="#">Child 1.2</div></a>
</div>
</div>
</div>
</body>
</html>
Problemet opstår i Mozilla, hvis man fører musen over enten "Child 1.1" eller "Child 1.2" - baggrundsfarven ændre sig på "Parent" og ikke på den Child man peger på.