我试图让它在 currentLetter 变量达到 34 后颜色改变,但由于某种原因,它只是在我点击时改变颜色。
var isStart = false;
var letterString = "D0E916C0A8CED059359C02DARREN KORB - PALE WATCHERS.mp3E415AAB0014400E104B40DE96A0";
var letters = letterString.split('');
var currentLetter = 0;
function changeLetter() {
$("#t-" + currentLetter).text(letters[currentLetter - 1]);
currentLetter += 1;
}
$(document).ready(function () {
var image = $('#content').click(function () {
if (!isStart) {
isStart = true;
setInterval(changeLetter, 100);
}
if (currentLetter == 34) {
$("#t-1").css("color", "red");
}
});
});
非常感谢任何帮助,在此先感谢!