<html>
<head>
<title></title>
<script type="text/javascript">
var arr = [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
];
function init() {
var i, j;
for (i = 0; i < arr.length; i++) {
for (j = 0; j < arr[i].length; j++) {
var d = document.createElement("div");
d.style.cssText = "position:absolute;border:5px solid black;";
d.style.width = 40 + "px";
d.style.height = 40 + "px";
d.style.left = j * 42 + "px";
d.style.top = i * 42 + "px";
d.id = i + "" + j;
if (arr[i][j] == 0) {
var time, number = 0;
d.style.backgroundColor = setInterval(function () {
number++;
if (number % 3 == 1) {
d.style.backgroundColor = "red";
}
else if (number % 3 == 2) {
d.style.backgroundColor = "blue";
}
else {
d.style.backgroundColor = "green";
}
if (number > 100) {
clearInterval(time);
}
}, 500)
}
document.body.appendChild(d);
}
}
}
window.onload = function () { init(); }
</script>
</head>
<body>
</body>
</html>
<head>
<title></title>
<script type="text/javascript">
var arr = [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
];
function init() {
var i, j;
for (i = 0; i < arr.length; i++) {
for (j = 0; j < arr[i].length; j++) {
var d = document.createElement("div");
d.style.cssText = "position:absolute;border:5px solid black;";
d.style.width = 40 + "px";
d.style.height = 40 + "px";
d.style.left = j * 42 + "px";
d.style.top = i * 42 + "px";
d.id = i + "" + j;
if (arr[i][j] == 0) {
var time, number = 0;
d.style.backgroundColor = setInterval(function () {
number++;
if (number % 3 == 1) {
d.style.backgroundColor = "red";
}
else if (number % 3 == 2) {
d.style.backgroundColor = "blue";
}
else {
d.style.backgroundColor = "green";
}
if (number > 100) {
clearInterval(time);
}
}, 500)
}
document.body.appendChild(d);
}
}
}
window.onload = function () { init(); }
</script>
</head>
<body>
</body>
</html>
