hjælp til løsning af javascriptproblem/dropdownmenu
er der nogen der kan fortælle mig hvorfor den her dropdown menu ikke virker og hvad jeg skal gøre for at fikse den?<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.3w.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Menu</title>
<style type="text/css">
.menulinie {
background: #567789;
color: #ffffff;
}
.menu {
background: #567789;
border:solid outset #567789 2px;
visibility: hidden;
position: absolute;
}
.menu a {
color: red;
text-decoration: none;
}
.menu a:hover {
color: red !important;
}
</style>
<script language="javascript" type="text/javascript">
aktiv = '';
document.onmouseover=mouseOver;
function mouseOver() {
element = window.event.srcElement;
id = element.id;
if (id.indexOf('top_') == 0 {
menunavn = 'menu_'+ id.substring(4);
menu=document.getElementById(menunavn);
if (aktiv !=''){
aktiv_menu = document.getElementById(aktiv);
aktiv_menu.style.visibility = 'hidden';
}
aktiv = menunavn;
menu.style.top =33;
top_menu = document.getElementById(id);
menu.style.pixelLeft = top_menu.offsetLeft;
menu.style.visibility = 'visible';
}
if (id == 'body') {
if (aktiv !='') {
aktiv_menu = document.getElementById(aktiv);
aktiv_menu.style.visibility = 'hidden';
aktiv = '';
}
}
}
</script>
</head>
<body id="body">
<div class="menulinie">
<span id="top_forening">Foreningen</span>
<span id="top_info">Information</span>
<span id="top_forum">Forum</span>
<span id="top_kalender">Kalender</span>
</div>
<p>
<div id="menu_forening" class="menu">
<a href="http://www.google.dk">Bestyrelsen</a></br>
<a href="http://www.google.dk">Vedtægter</a></br>
<a href="http://www.google.dk">Indmeldelse</a></br>
</div>
<div id="menu_info" class="menu">
<a href="http://www.google.dk">ttt</a></br>
<a href="http://www.google.dk">ttt</a></br>
<a href="http://www.google.dk">ttt</a></br>
</div>
<div id="menu_forum" class="menu">
<a href="http://www.google.dk">Medlem</a></br>
<a href="http://www.google.dk">Gæst</a></br>
</div>
<div id="menu_kalender" class="menu">
<a href="http://www.google.dk">Arrangementer</a></br>
<a href="http://www.google.dk">Møder</a></br>
</div>
</body>
</html>
