Please I need help with my code. I have been trying to create multiple automatic slideshow on the same page with Javascript.
I tried using the following code. var slideIndex = [1,1,1,1,1]; var dotId = ["dot1", "dot2", "dot3", "dot4", "dot5"]; var slideId = ["mySlides1", "mySlides2", "mySlides3", "mySlides4", "mySlides5"] showSlides(1, 0); showSlides(1, 1); showSlides(1, 2); showSlides(1, 3); showSlides(1, 4); function showSlides(n, no) { var i; var x = document.getElementsByClassName(slideId[no]); var dots = document.getElementsByClassName(dotId[no]); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } slideIndex[n]++; if (slideIndex[no] > x.length) {slideIndex = 1} for (i = 0; i < dots.length; i++) { Â Â dots[i].className = dots[i].className.replace(" active", ""); } x[slideIndex[no]-1].style.display = "block"; dots[slideIndex[no]-1].className += " active"; setTimeout(showSlides, 2000); }