JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://generamosclientes.com/js/vendor/jquery-1.8.2.min.js" ></script>
<div class="img" style="background:red"></div>
<div class="img" style="background:yellow"></div>
<div class="img" style="background:blue"></div>
<div class="img" style="background:purple"></div>
<div class="img" style="background:gray"></div>

CSS

.img { width: 500px; height: 300px; position: absolute; top: 0; left: 0; }

JavaScript

$img = $('.img')
$img_l = $img.length;
$i = $img_l;

setInterval(function(){
    
     if($i<=0){ $i = $img_l; $img.fadeIn(800);  }
     $img.eq($i).fadeOut(800);
     $i--;
    
}, 2500);