Huhej, her har du mig!.. ;)
Undskyld forsinkelsen, men jeg har været temmelig ophængt hele dagen!.. Nu har jeg løsningen på dit problem!.. Du kan finde en demo her:
http://www.dkvision.dk/tr/test2.aspHer er hele koden uden din database-tilgang, men den kan du hurtigt sætte ind igen. Læg mærke til de forskellige loops, og hvordan de er sat sammen i modsætning til din:
<html>
<head>
<script language=\"javascript\">
ns4 = (document.layers) ? true:false
ie4 = (document.all) ? true:false
ng5 = (document.getElementById) ? true:false
function hideSec() {
if (ng5) document.getElementById(\'sec1\').style.visibility = \"hidden\"
else if (ns4) document.sec1.visibility = \"hide\"
else if (ie4) sec1.style.visibility =\"hidden\"
}
function showSec(n) {
hideSec();
if (ng5) document.getElementById(\'sec\' + n).style.visibility = \"visible\";
else if (ns4) document.layers[\"sec\" + n].visibility = \"show\";
else if (ie4) document.all[\"sec\" + n].style.visibility = \"visible\";
}
f7_droplayer=new Array()
<%
antal = 0
antal2 = 1
do until antal = 10
Response.Write \"f7_droplayer[\" & antal & \"]=\"\"drop\" & antal2 & \"\"\"\" & VbCrLf
antal = antal + 1
antal2 = antal2 + 1
loop
%>
f7_v4=(parseInt(navigator.appVersion)>=4 && parseInt(navigator.appVersion)<=5)?1:0
f7_ie=(document.all && f7_v4)?1:0
f7_ns=(document.layers && f7_v4)?1:0
function f7_showdrop(thelayer){
f7_keep=thelayer; f7_hideall(); f7_showitnow=1
f7_showit(thelayer)
}
function f7_showit(thelayer){
if(f7_ie){ eval(f7_droplayer[thelayer]+\'.style.visibility=\"visible\"\') }
if(f7_ns){ eval(\'document.\'+f7_droplayer[thelayer]+\'.visibility=\"show\"\');}
}
function f7_hidedrop(){
f7_keep=-1; setTimeout(\'f7_hideall()\',500)
}
f7_keep=-1
function f7_hideall(){
for(i=0;i<f7_droplayer.length;i++){
f7_hideit=0; f7_checkmousepos(i)
if(f7_ie && f7_keep!=i){
if(f7_hideit){ eval(f7_droplayer[i]+\'.style.visibility=\"hidden\"\') }
}
if(f7_ns && f7_keep!=i){
if(f7_hideit){ eval(\'document.\'+f7_droplayer[i]+\'.visibility=\"hide\"\') }
}
}
}
document.onmousemove = f7_getmousepos
if (f7_ns) document.captureEvents(Event.MOUSEMOVE)
function f7_getmousepos(e){
if(f7_ns){f7_mousex=e.pageX; f7_mousey=e.pageY}
if(f7_ie){f7_mousex=event.clientX; f7_mousey=event.clientY;}
}
function f7_checkmousepos(i){
if(f7_ns){
f7_x_min=eval(\'document.\'+f7_droplayer[i]+\'.left\')
f7_x_max=f7_x_min+eval(\'document.\'+f7_droplayer[i]+\'.clip.width\')
f7_y_min=eval(\'document.\'+f7_droplayer[i]+\'.top\')
f7_y_max=f7_y_min+eval(\'document.\'+f7_droplayer[i]+\'.clip.height\')
}
if(f7_ie){
f7_x_min=eval(f7_droplayer[i]+\'.style.pixelLeft\')
f7_x_max=f7_x_min+eval(f7_droplayer[i]+\'.style.pixelWidth\')
f7_y_min=eval(f7_droplayer[i]+\'.style.pixelTop\')
f7_y_max=f7_y_min+eval(f7_droplayer[i]+\'.style.pixelHeight\')
}
if (f7_mousex>=f7_x_min && f7_mousex<=f7_x_max && f7_mousey>=f7_y_min && f7_mousey<=f7_y_max){
f7_hideit=0; setTimeout(\'f7_hideall()\',500)
}
else { f7_hideit=1 }
return f7_hideit
}
if(f7_ie){
document.write(\'<style type=\"text/css\"><!--\')
document.write(\'.dropdown {padding-left:10px; padding-top:10px; padding-right:10px; padding-bottom:10px}\')
document.write(\'p { margin-top:0px; margin-bottom:6px }\')
document.write(\'a { text-decoration: none }\')
document.write(\'a:hover { color: white; text-decoration: underline }\')
document.write(\'--></style>\')
}
</script>
<title>Links</title>
<style type=\"text/css\">
<!--
p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height:17px}
td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;}
.header { font: bold 24px Arial, Verdana, Helvetica, sans-serif }
.subhead { font-weight: bold; font-size: 12px }
.list { font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-decoration: none }
.forms { font-size: 12px; font-family: Arial, Verdana, Helvetica, sans-serif }
.dropdown { position: absolute; width:130px; color:black; border: #000000; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: #EFEFEF; layer-background-color: #EFEFEF; top:130px; z-index:1; visibility: hidden ;}
.drophead { color:#333333; font: bold 12px Verdana, Arial, Helvetica, sans-serif; text-decoration:none }
.dropitem { text-decoration:none; color:black; font: 12px Arial, Verdana, Helvetica, sans-serif;}
.drophead:hover { color:black; text-decoration:none }
.dropitem:hover { color:black; font: bold }
-->
</style>
</head>
<body bgcolor=\"#FFFFFF\" text=\"#333333\" background=\"gfx/bg.gif\" link=\"#990000\" vlink=\"#990000\" alink=\"#990000\" topmargin=\"4\">
<table width=\"400\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"#000000\" align=\"center\">
<%
\'-- forbindelse til databasen
count = 0
count2 = 1
topmargin = 20
do until count = 10
%>
<div id=drop<%=count2%> class=dropdown style=left:25px;top:<%=topmargin%>px; onmouseover=f7_showdrop(<%=count%>) onmouseout=f7_hidedrop()>
<input type=text value=\"thomas<%=count%>@thomas-regin.com\" name=Siteurl>
<input type=\"submit\" value=\"Update\" style=\"font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;\" name=\"submit\" >
</DIV>
<% count = count + 1
count2 = count2 + 1
topmargin = topmargin + 20
Loop
count = 0
do until count = 10
%>
<tr bgcolor=\"CCCC99\">
<td width=\"18\">
<a style=cursor:hand class=drophead onmousedown=f7_showdrop(<%=count%>) onmouseout=f7_hidedrop()><img src=\"gfx/ie.gif\" width=\"18\" height=\"18\"></a>
</td>
<td width=\"133\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">
</font></td>
<td width=\"71\">
</td>
</tr>
<%
count = count + 1
loop
%>
</table>
</body>
</html>
Håber at du kunne bruge det til noget!..
God fornøjelse,
Thomas.