how to add JS to this code so it will automatically slide? <p>how do i make this automatically slide? I've already made it so you can manually slide them, but i want them moving at the same time.</p> <pre><code>var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); if (n &gt; slides.length) { slideIndex = 1 } if (n &lt; 1) { slideIndex = slides.length } for (i = 0; i &lt; slides.length; i++) { slides[i].style.display = "none"; } slides[slideIndex - 1].style.display = "block"; dots[slideIndex - 1].className += " active"; } }; </code></pre>