这是我的代码:
var timeout = 0;
function start() {
for (var i = 0; i < 1000; i += 50) {
timeout = setTimeout(function () {
aRandomNumber1 = random();
aRandomNumber2 = random();
aRandomNumber3 = random();
document.getElementById('field1').innerHTML = '<img src="' + img[aRandomNumber1] + '" alt="Bild1">';
document.getElementById('field2').innerHTML = '<img src="' + img[aRandomNumber2] + '" alt="Bild2">';
document.getElementById('field3').innerHTML = '<img src="' + img[aRandomNumber3] + '" alt="Bild3">';
}, i);
}
clearTimeout(timeout);
timeout = 0;
图像并没有停止在这一点上。下一步应该改变。