Pause Slideshow On Hover

I am very new to building slideshows from scratch and have little or no scripting experience. I am using the following script succesfully but would like to pause on hover.

The containing div has a class .SlideshowContainer and an ID of #DiviSlideShowContainer

var slideIndex = 0;

showSlides();

function showSlides() {
var i;
var slides = document.getElementsByClassName(“IndividualSlide”);
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
slides[slideIndex-1].style.display = “block”;
setTimeout(showSlides, 6000); // Change image every 6 seconds
}

Read more here:: Pause Slideshow On Hover

Leave a Reply

Your email address will not be published. Required fields are marked *