granite.png
black.png
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
img
{
float:left;
height:20px;
width:20px;
margin:0px;
padding-top:0px;
padding-bottom:0px;
padding-right:0px;
padding-left:0px;
}
br
{
clear:both;
}
</style>
<script type="text/javascript">
var t=0;
function mouseOver(imgID)
{
t+=1
document.getElementById(imgID).src ="granite.png";
var r=setTimeout(function(){document.getElementById(imgID).src ='black.png';},t); // Thank you Rogi!
}
</script>
</head>
<body>
<script type="text/javascript">
var c=0;
for (c = 0; c <= 255; c++)
{
if (c % 16 == 0)
{
document.write("<br />");
}
document.write("<img src=\"black.png\" id=\"" + c + "\" onmouseOver=\"mouseOver(" + c + ")\">");
}
</script>
<br />
</body>
</html>
No comments:
Post a Comment