Line 140: | Line 140: | ||
<span class="dot" onclick="currentSlide(2)"></span> | <span class="dot" onclick="currentSlide(2)"></span> | ||
<span class="dot" onclick="currentSlide(3)"></span> | <span class="dot" onclick="currentSlide(3)"></span> | ||
− | <span class="dot" onclick="currentSlide( | + | <span class="dot" onclick="currentSlide(4)"></span> |
</div> | </div> | ||
Line 154: | Line 154: | ||
showSlides(slideIndex = n); | showSlides(slideIndex = n); | ||
} | } | ||
− | + | function showSlides(n) { | |
+ | var i; | ||
+ | var slides = document.getElementsByClassName("mySlides"); | ||
+ | var dots = document.getElementsByClassName("dot"); | ||
+ | if (n > slides.length) {slideIndex = 1} | ||
+ | if (n < 1) {slideIndex = slides.length} | ||
+ | for (i = 0; i < slides.length; i++) { | ||
+ | slides[i].style.display = "none"; | ||
+ | } | ||
+ | for (i = 0; i < dots.length; i++) { | ||
+ | dots[i].className = dots[i].className.replace(" active", ""); | ||
+ | } | ||
+ | slides[slideIndex-1].style.display = "block"; | ||
+ | dots[slideIndex-1].className += " active"; | ||
+ | } | ||
+ | </script> | ||
<script> | <script> |
Revision as of 05:06, 12 October 2018
<!DOCTYPE html>