我设法设置了一个脚本来更改表格中的字符并更改某些字符的颜色。我想要做的是在第二次点击时有不同的字符和颜色,但我不知道我会怎么做。
var isStart = false;
var letterString = "D0E916C0A8CED059359C02DARREN KORB - PALE WATCHERS.mp3E415AAB0014400E104B40DE96A0";
var letters = letterString.split('');
var currentLetter = 0;
var intervalID;
function changeLetter() {
$("#t-"+currentLetter).text(letters[currentLetter - 1]);
currentLetter +=1 ;
if (currentLetter == 23) {
$("#t-23").css("color", "#d49a9a");
}
if (currentLetter == 24) {
$("#t-24").css("color", "#d49a9a");
}
if (currentLetter == 25) {
$("#t-25").css("color", "#d49a9a");
}
if (currentLetter == 26) {
$("#t-26").css("color", "#d49a9a");
}
}
$(document).ready(function() {
var image = $('#content').click(function() {
if (!isStart) {
isStart = true;
intervalID = setInterval(changeLetter, 100);
}
});
});