onmouseover i td virker ikke??
nu har jeg siddet og kæmpet i timer for at få den ONMOUSEOVER og ONMOUSEOUT til at virke i følgende kode:<?
$cellsize=20;
$height=10;
$width =10;
$mapwidth=($cellsize*$width);
$map=array(2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<body bgcolor="black" text="White" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<html>
<head>
<script>
function drawtable()
{
var colordata = [<? echo "'".join("','",$map)."'"; ?>];
var cnt=0;
var table="<table align='center' cellspacing='0' cellpadding='0' border='1' width='<? echo $mapwidth ?>' borderColor='gray'>";
for(ypos = 0; ypos < <? echo $width ?> ;ypos++)
{
table+="<tr>";
for(xpos= 0 ;xpos<<? echo $height ?>;xpos++)
{
if(colordata[cnt]==1)
{
bcolor="blue";
}
else
{
bcolor="green";
}
table+="<td height='20' width='20' bgcolor=\'"+bcolor+"\' ";
table+="bordercolor=\"gray\" ";
table+="onmouseover=\"java script:this.borderColor='yellow';\" ";
table+="ONMOUSEOUT =\"java script:this.borderColor='gray';\" ";
table+=">";
table+="</td>";
cnt++;
}
table+="</tr>";
}
table+="</table>";
document.write(table);
}
</script>
<title>Untitled</title>
</head>
<body onload="java script: drawtable();">
</body>
</html>
<? exit; ?>
resultatet ad dette kan ses her:
http://www.escalator.nu/maptest/
hva faen gør jeg galt??