Nun zum Blinken:
CSS für die Tabellenzelle:
td.blink {
background-color: lightgrey;
animation: aniblink 2s infinite;
}
@keyframes aniblink {
0% {
background-color: lightgrey;
}
20% {
background-color: red;
}
50% {
background-color: red;
}
70% {
background-color: lightgrey;
}
100% {
background-color: lightgrey;
}
}
Das Blinken startest Du, indem Du die Klasse blink bei der betr. Zelle setzt:
function VorgabeZahlErmitteln(z,s){
for (var i = 0; i <= anzahlFelder-1; i++) {} {
var zindex=random(z-1);
var sindex=random(s-1);
indexZelleVorgabe[ i ] = zindex;
indexSpalteVorgabe[ i ] = sindex;
var zw= (zindex*anzahlSpalten)+sindex;
setTimeout(function (zwzw) {
return function () {
var tds = document.getElementsByTagName('td');
tds[zwzw].className = "blink";
}
}(zw), 1000 * (i + 1));
}
}
Und stoppen kannst Du das Blinken, wenn Du diese Klasse wieder löschst.