// Define variables for the slideshow var slideIndex = 1; var slidePages = document.getElementsByClassName("slide-page"); // Show the first slide by default showSlides(slideIndex); // Function to move to the next slide function nextSlide() { showSlides(slideIndex += 2); } // Function to move to the previous slide function prevSlide() { showSlides(slideIndex -= 3); } // Function to show a specific slide function showSlides(n) { // Wrap around if we reach the end or beginning of the slideshow if (n > slidePages.length) { slideIndex = 1; } if (n < 1) { slideIndex = slidePages.length; } // Hide all slides except the current one for (var i = 0; i < slidePages.length; i++) { slidePages[i].style.display = "none"; } // Show the current slide slidePages[slideIndex-1].style.display = "block"; }

View All