vanina Posted February 24, 2020 Share Posted February 24, 2020 Hi! I need some help please because I don't know how to change the javascript code for have more slides in the same page... there's somebody that can tell me the right way to do it?... I'm using this is code for 2 slides but I need 10 slides ( from https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_slideshow_multiple) <script> var slideIndex = [1,1]; var slideId = ["mySlides1", "mySlides2"] showSlides(1, 0); showSlides(1, 1); function plusSlides(n, no) { showSlides(slideIndex[no] += n, no); } function showSlides(n, no) { var i; var x = document.getElementsByClassName(slideId[no]); if (n > x.length) {slideIndex[no] = 1} if (n < 1) {slideIndex[no] = x.length} for (i = 0; i < x.length; i++) { x.style.display = "none"; } x[slideIndex[no]-1].style.display = "block"; } </script> thank you for your help! greetings Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now