I have this function which loops through a list of strings every 5 seconds. I would like it to stay on the last string after finishing the loop. What do I need to change here?
window.specialWorkBoxStyleOverride = function(workBox) {
var statusTextBox = $("<div class = 'status-description-box'></div>");
$(workBox).append(statusTextBox);
var statusTexts = ["Checking", "Updating", "Processing", "Saving"];
var idx = 0;
var updateStatus = function() {
statusTextBox.text(statusTexts[idx]);
idx = (idx + 1) % statusTexts.length;
setTimeout(updateStatus, 5000);
};
updateStatus();
};
Thanks a lot.