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

Line 155: Line 155:
 
}
 
}
  
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>
 
var slideIndex = 0;
 
var slideIndex = 0;
Line 189: Line 174:
 
     slides[slideIndex-1].style.display = "block";   
 
     slides[slideIndex-1].style.display = "block";   
 
     dots[slideIndex-1].className += " active";
 
     dots[slideIndex-1].className += " active";
     setTimeout(showSlides, 5000); // Change image every 2 seconds
+
     setTimeout(showSlides, 5000); // Change image every 5 seconds
 
}
 
}
 
</script>
 
</script>
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 05:05, 12 October 2018

<!DOCTYPE html>

1 / 4
Caption Text
2 / 4
Caption Two
3 / 4
Caption Three
4 / 4
Caption Three