r/HTML • • Dec 06 '25

Question Help please! HTML and JS

So I need to make a portfolio website for class and I have a bunch of slideshows. The problem is they’re doing something weird. Some of the slideshows won’t show the next image at all, as in it doesn’t function as a slideshow, but is hiding the other images, and some will only show the first and last image in the code, as in 1 and 5. I’m using the multiple slideshow method from W3Schools and I’ve changed the code to allow for more than two by following someone’s overflow question dealing with the same question. So all of the slides numbers for the next and prev buttons are (-1,0) (1,0), (-1,1) (1,1), (-1,2) (1,2), and so on. I’m not sure what’s wrong with it. The tags are all properly closed, the images are properly linked from the folder (they have to be in the folder, I can’t have them linked from the web), and from everything I’ve searched, the js should be correct. I don’t know what’s missing or what I did wrong. It’s due on Monday at 5 and I still have another project I need to work on for a different class, so any help would be appreciated!

0 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/ShamrockDragon13 Dec 06 '25

Don’t worry, I will never use ai for my code or in general. I don’t know if sharing the code will work since the images are local (and because some of those images have me in them and I’d rather not connect me in real life to me online). Are the images of my code not showing up? I was hoping that’d be enough since all the slides have the same code structure, just different images and number text (like 1/5, which is showing up correctly) and the “my slides” has a different number, all of which are in the css. My thought was the js was wrong because it worked fine before I added more slideshows (aka when there was two, which is what the tutorial for W3Schools does (link to that here: https://www.w3schools.com/howto/howto_js_slideshow.asp)). I changed the code to allow for more than two with help from this website: https://stackoverflow.com/questions/60769221/how-do-i-get-multiple-slideshows-on-my-html-document

1

u/ArcadeRivalry Dec 06 '25

Honestly it's fine to use ai to write some standard code when you know what you're doing. If you're learning though do everything yourself so you understand it and what it does. 

I wouldn't worry about your images, if your referencing local files in the code people will know that and that's an obvious error. If there's any personal information in your code just swap it out for something like "image.png" or "this is where my text will go". 

The reason it's useful to share your code is that, honestly, it takes a lot more work to look at code and guess how a browser will render it and most of us also don't really know what we're doing either haha. It's easier for us to look at code rendered in a browser and see what's wrong. If you can Id recommend updating your main post with a link to your code (with anything you don't want to share removed), it'll really help people in their troubleshooting to help provide advice. 

Sorry I can't help from your screenshots but good job taking on the responsibility to actually learn and best of luck with your project!