Difference between revisions of "Team:Mingdao/DM test"

Line 156: Line 156:
 
   showSlides(slideIndex = n);
 
   showSlides(slideIndex = n);
 
}
 
}
 +
 
function showSlides(n) {
 
function showSlides(n) {
 
   var i;
 
   var i;
Line 170: Line 171:
 
   slides[slideIndex-1].style.display = "block";   
 
   slides[slideIndex-1].style.display = "block";   
 
   dots[slideIndex-1].className += " active";
 
   dots[slideIndex-1].className += " active";
}
 
</script>
 
 
<script>
 
var slideIndex = 0;
 
showSlides();
 
 
function showSlides() {
 
    var i;
 
    var slides = document.getElementsByClassName("mySlides");
 
    var dots = document.getElementsByClassName("dot");
 
    for (i = 0; i < slides.length; i++) {
 
      slides[i].style.display = "none"; 
 
    }
 
    slideIndex++;
 
    if (slideIndex > slides.length) {slideIndex = 1}   
 
    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";
 
    setTimeout(showSlides, 5000); // Change image every 5 seconds
 
 
}
 
}
 
</script>
 
</script>
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 04:38, 15 October 2018

1 / 4
2 / 4
3 / 4
4 / 4