JSFiddle - React, Tailwind, and code Playground
by niklasvh
HTML
<div id="text_rotator1_1">1</div>
<div id="text_rotator1_2">2</div>
<div id="text_rotator1_3">3</div>
<div id="text_rotator1_4">4</div>
JavaScript
$('div').hide();
function start(){
$("#text_rotator1_1").fadeIn(3000,function(){
$("#text_rotator1_2").fadeIn(3000, function(){
$("#text_rotator1_3").fadeIn(3000, function() {
$("#text_rotator1_4").fadeIn(3000, function() {
$("#text_rotator1_1").fadeOut(1000);
$("#text_rotator1_2").fadeOut(1000);
$("#text_rotator1_3").fadeOut(1000);
$("#text_rotator1_4").fadeOut(1000, start);
});
});
});
});
}
start();