Start Test
HTML...
<table id="tbl">
<tbody>
<tr>
<td>row 1</td>
</tr>
<tr>
<td>row 2</td>
</tr>
</tbody>
</table>
CSS...
td {
background-color: white;
}
td.animate {
-webkit-transition-property: background;
-webkit-transition-duration: 10s;
}
td.over {
background-color: red;
}
JavaScript
var ColourNextCell = function(fpsDiv, time, frames, tbl, x, y) {
...
if (totalFrames % 200 === 0) {
HogForTwoHundredMilliseconds(10);
}
...
};
var HogForTwoHundredMilliseconds = function(fireAgainCountDown) {
var startTime = new Date().getTime(), currentTime;
while(true) {
currentTime = new Date().getTime();
if (currentTime - startTime >= 1000) {
break;
}
}
if (fireAgainCountDown > 0) {
setTimeout(function() { HogForTwoHundredMilliseconds(--fireAgainCountDown); }, 0);
}
};