mainjs.js 478 B

123456789101112131415
  1. var slideIndex = 0;
  2. showSlides();
  3. function showSlides() {
  4. var i;
  5. var slides = document.getElementsByClassName("mySlides");
  6. for (i = 0; i < slides.length; i++) {
  7. slides[i].style.display = "none";
  8. }
  9. slideIndex++;
  10. if (slideIndex > slides.length) {slideIndex = 1}
  11. slides[slideIndex-1].style.display = "block";
  12. setTimeout(showSlides, 2000); // Change image every 2 seconds
  13. }