Use setInterval to slide images once every one second.
setInterval(function() { slideImage();}, 1000);
When user switch to another browser tab, and comes back to the tab after some time(e.g., 5 minutes), the images slide once every 100 milliseconds. The setInterval function execution is actually queued when the browser tab is inactive.
How to stop the slide function when the image slider is invisible?