JSFiddle - React, Tailwind, and code Playground

by mblase75

HTML

<div class="row">
    <div class="image">aa</div>
    <div class="image">bb</div>
    <div class="image">cc</div>
</div>

CSS

.active {
    color: red;
}

JavaScript

function looper() {
    if ($('.row .image:not(".active")').first().addClass('active').length) {
        console.log('looping');
        setTimeout(looper, 1000);
    };
}

looper();