to links og et eksempel baseret på første link...
http://www.eksperten.dk/spm/700382#rid6193072 <- brugt i eksemplet
http://www.eksperten.dk/spm/700575#rid6192871 <- lidt anderledes...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"><title>Ingen titel</title>
<script type="text/javascript">
<!--
mychkvar=-1;
var IE=document.all?true:false;
if(!IE)document.captureEvents(Event.mousemove)
document.onmousemove=mousepos;
var cury=0;
var curx=0;
function mousepos(e){
if(IE){
myscrolltop=(tmenu=document.documentElement.scrollTop)? tmenu : document.body.scrollTop;
myscrollleft=(lmenu=document.documentElement.scrollLeft)? tmenu : document.body.scrollLeft;
tmpy=event.clientY+myscrolltop;
tmpx=event.clientX+myscrollleft;
}else{
tmpy=e.pageY;
tmpx=e.pageX;
myscrolltop=0;
myscrollleft=0;
}
cury=tmpy;
curx=tmpx;
}
tmpx1=0;
tmpx2=0;
tmpy1=0;
tmpx2=0;
tmpx1b=0;
tmpx2b=0;
tmpy1b=0;
tmpx2b=0;
tmpcurnode="";
function hideshowdiv(tmpid,tmpcur,pleft,ptop){
mychkvar=1;
if(tmpid=document.getElementById(tmpid)){
if(tmpcurnode!="")tmpcurnode.style.visibility='hidden';
tmpcurnode=tmpid;
xleft=tmpcur.offsetLeft;
xtop=tmpcur.offsetTop;
tmpcur2=tmpcur;
while(tmpcur2=tmpcur2.offsetParent){
xleft=xleft+tmpcur2.offsetLeft;
xtop=xtop+tmpcur2.offsetTop;
}
tmpy1b=xtop;
tmpx1b=xleft;
tmpy2b2=xtop+tmpcur.offsetHeight;
tmpx2b=xleft+tmpcur.offsetWidth;
if(pleft!="d"){
tmpid.style.top=xtop+ptop+"px";
tmpid.style.left=xleft+pleft+"px";
}else{
tmpid.style.top=tmpy2b2+"px";
tmpid.style.left=xleft-tmpcur.offsetLeft+"px";
}
tmpid.style.visibility='visible';
tmpy1=tmpid.offsetTop;
tmpx1=tmpid.offsetLeft;
tmpy2=tmpid.offsetTop+tmpid.offsetHeight;
tmpx2=tmpid.offsetLeft+tmpid.offsetWidth;
}
}
window.onload=runhidectrl;
function runhidectrl(){
if(tmpcurnode!=""){
if((curx<tmpx1)||(curx>tmpx2)||(cury<tmpy1)||(cury>tmpy2)){
if((curx<tmpx1b)||(curx>tmpx2b)||(cury<tmpy1b)||(cury>tmpy2b2)){
tmpcurnode.style.visibility="hidden";
}
}if(mychkvar==0)tmpcurnode.style.visibility="hidden";
}
setTimeout("runhidectrl();",100);
}
//-->
</script>
</head>
<body>
<br><br><br><br><br><br><br><b onmouseover="hideshowdiv('menu1',this,0,0)" style="text-decoration:none;">?</b><br><br><br><br>
<b onmouseover="hideshowdiv('menu1',this,100,0)" style="text-decoration:none;">?</b><br><br>
<b onmouseover="hideshowdiv('menu1',this,'d','d')" style="text-decoration:none;">?</b>
<div id="menu1" style="visibility:hidden;position:absolute;top:0px;left:0px;background-color:green;"><br>
<b>abc</b><br>
<h1>def</h1>
</div>
</body></html>