Can you help me create a loop that will continuously run this script after it finishes executing, repeating the process indefinitely?
I want to keep running this code over and over again.
This script is using jQuery version 3.5.1
// Title
var title1 = document.getElementById("slide-text-title-id");
var title2 = document.getElementById("slide-text-title-id-2");
var title3 = document.getElementById("slide-text-title-id-3");
$(document).ready(function () {
setTimeout(function () {
$(title1).css("opacity", "1");
$(title1).css("transition", "0.5s");
}, 500);
setTimeout(function () {
$(title1).css("opacity", "0");
}, 6000);
setTimeout(function () {
$(title1).css("opacity", "1");
}, 20000);
});
$(document).ready(function () {
setTimeout(function () {
$(title2).css("opacity", "1");
$(title2).css("transition", "0.5s");
}, 9000);
setTimeout(function () {
$(title2).css("opacity", "0");
}, 13500);
setTimeout(function () {
$(title2).css("opacity", "1");
}, 20000);
});
$(document).ready(function () {
setTimeout(function () {
$(title3).css("opacity", "1");
$(title3).css("transition", "0.5s");
}, 16000);
setTimeout(function () {
$(title3).css("opacity", "0");
}, 21000);
setTimeout(function () {
$(title3).css("opacity", "1");
}, 26500);
});