|
|
Line 173: |
Line 173: |
| slides[slideIndex-1].style.display = "block"; | | slides[slideIndex-1].style.display = "block"; |
| dots[slideIndex-1].className += " active"; | | dots[slideIndex-1].className += " active"; |
− | }
| |
− |
| |
− | var slideIndex = 0;
| |
− | showSlides();
| |
− |
| |
− | function showSlides() {
| |
− | var i;
| |
− | var slides = document.getElementsByClassName("mySlides");
| |
− | 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, 2000); // Change image every X000 seconds
| |
| } | | } |
| | | |