Hvor går det lige galt henne?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<title>Untitled</title>
<script language="javascript" type="text/javascript">
var OpC = new Array();
var ie,moz,css3; function startOpChange(elm,end,tim){
ie = !!elm.filters;
moz = elm.style.MozOpacity != undefined;
css3 = elm.style.opacity != undefined;
if (!ie && !moz && !css3)return;
var idx = OpC.length;
for(var i=0;idx>i;i++){
if(OpC[i][0]==elm){
clearInterval(OpC[i][4]);
idx = i;
break;
}
OpC[idx] = new Array();
}
if(idx==0)OpC[idx] = new Array();
if(ie)actOp=elm.filters.alpha.opacity;
else if(css3)actOp=(elm.style.opacity*100);
else actOp=(elm.style.MozOpacity*100);
if (actOp!=end){
OpC[idx][0]=elm;
OpC[idx][1]=actOp;
OpC[idx][2]=end;
OpC[idx][3]=(end>actOp)?1:-1;
var delayTime = Math.floor((tim*1000)/Math.abs((actOp-end)));
OpC[idx][4]=setInterval("opChange("+idx+")",delayTime);
}
}
function opChange(idx){
OpC[idx][1]+=OpC[idx][3];
if (ie)OpC[idx][0].filters.alpha.opacity=OpC[idx][1];
else if(css3)OpC[idx][0].style.opacity=Math.min(0.99,OpC[idx][1]/100);
else OpC[idx][0].style.MozOpacity=Math.min(0.99,OpC[idx][1]/100);
if (OpC[idx][1]==OpC[idx][2]){
clearInterval(OpC[idx][4]);
return;
}
}
</script>
</head>
<body o nload="startOpChange(document.getElementById('test'),0,1);">
<div id="test" style="background-color: Green; color: White; padding: 10px;filter:alpha(opacity=90);-moz-opacity:0.9;opacity:0.9;" onmouseover="startOpChange(document.getElementById('test'),20,1);">sdafsdgsd gsdg sd gsd gsd gsd </div>
</body>
</html>