Hej.
Jeg har fundet en JavaScript menu, som jeg benytter. Jeg har dog opdaget, at alt hvad der står på venstre side af menuen bliver placeret en del afstand derfra. Ca. samme afstand som "drop-down-menuen"'s bredde.
Hvordan løses dette?
http://www.myfront.dk/testmenu.htm
<style type="text/css">
#sddm li
{ margin: 0;
padding: 0;
list-style: none;
float: left;
font: bold 11px tahoma}
#sddm li a
{ display: block;
margin: 0 1px 0 0;
color: #FFF;
text-align: center;
text-decoration: none}
#sddm div
{ position: absolute;
visibility: hidden;
margin: 0;
padding: 0;
background-color: #FFFFFF;
border: 1px solid <?php echo $cellcolor; ?>;
}
#sddm div a
{ position: relative;
display: block;
margin: 0;
padding: 2px 5px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
color: #000000;
font: 10px tahoma}
#sddm div a:hover
{ background: #eeeeee;
color: #000000}
</style>
<script language="javascript">
// Copyright 2006-2007 javascript-array.com
var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;
// open hidden layer
function mopen(id)
{
// cancel close timer
mcancelclosetime();
// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}
function mclosetime2()
{
closetimer = window.setTimeout(mclose, 0);
}
// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}
// close layer when click-out
document.onclick = mclose;
</script>
<table border="0" width="300" bgcolor="#999999" cellspacing="0" cellpadding="1">
<tr>
<td width="80%"><div align="right">text</div></td> <td width="20%">
<ul id="sddm">
<li><a href="#" onmouseover="mopen('m1')" onmouseout="mclosetime()"><img src="billeder/arrow_test.jpg" border="0" width="40" height="15"></a>
<div id="m1"
onmouseover="mcancelclosetime()"
onmouseout="mclosetime()">
Dette er menuen
</div>
</li>
</ul>