Jump to content

MondoDopeness

Members
  • Posts

    1
  • Joined

  • Last visited

MondoDopeness's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Can anyone elaborate on this? I'm good with HTML & CSS - but have hardly any experience using JS - I was able to get the 2 slideshows working, and they were able to be clicked left and right to the new slides, however, wanting to change these 2 slideshows to automatic has been a headache. I have made the changes the moderator suggested, changing the 2nd slide show class names mySlides2 and dots2... but don't know where to go from here... I don't understand how to make a "different function to run the second slideshow with the other class names." Thank you for any response. Here is where I am at: <script> var slideIndex = 0; showSlides(); function showSlides() { var i; var slides = document.getElementsByClassName("mySlides1"); var dots = document.getElementsByClassName("dot"); for (i = 0; i < slides.length; i++) { slides.style.display = "none"; } slideIndex++; if (slideIndex > slides.length) {slideIndex = 1} for (i = 0; i < dots.length; i++) { dots.className = dots.className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; setTimeout(showSlides, 2000); // Change image every 2 seconds } </script> <script> var slideIndex = 0; showSlides(); function showSlides() { var i; var slides = document.getElementsByClassName("mySlides2"); var dots = document.getElementsByClassName("dot2"); for (i = 0; i < slides.length; i++) { slides.style.display = "none"; } slideIndex++; if (slideIndex > slides.length) {slideIndex = 1} for (i = 0; i < dots.length; i++) { dots.className = dots.className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; setTimeout(showSlides, 2000); // Change image every 2 seconds } </script>
×
×
  • Create New...