Skip to content
Advertisement

Multiple Slideshow not working properly. Any Clue?

So basically, I’m trying to create multiple slideshows on the page with dots to switch between the slides (because I’ve already tried the arrow type button and it doesn’t workout for me idk), and the issue is that when I use more than one slideshow the dots on the first one either stop working or begin switching the below slideshows slides.

I have already seen a lot of threads about this issue and tried several answers to them, but none of them seem to work. So if anybody has any clue of what is happening in my code and knows the answer, it would be great. PD: I’m sorry if it contains any grammatic faults :c.

This is the code I’m using (originally from w3s: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_quotes_slideshow and https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_slideshow_multiple)

JavaScript
JavaScript

Advertisement

Answer

This code wont work because there’s a problem with your JavaScript as some variables are conflicting I will suggest you to make separate JavaScript file first and include it in your index.html like this ;

JavaScript

this way your code is separated and it’ll be easy to determine problems in your code. well after this follow the same pattern as per link you provided of w3cSchool. https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_quotes_slideshow and https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_slideshow_multiple)

commented out things that you should resolve according to your requirement;

these first two are the default one 3rd is my added one just like this you have to add yourself in the code

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement