JSFiddle - React, Tailwind, and code Playground

HTML

<div class="test">image: <span></span></div>

JavaScript

$(document).ready(function(){
 
 var indx = 0, loop, numberOfFeatures = 5;

 function imageRotate(){
  indx++;
  if (indx > numberOfFeatures) { indx = 1; }
  $('.test span').text(indx);
  loop = setTimeout( imageRotate , 1000 );
 }
 imageRotate();

 $('.test').hover(function(){
  clearTimeout(loop);
 }, function(){
  imageRotate();
 });
 
})