So, i’m doing my first attempt at actually using some JavaScript on a web page. I’m making use of JS to cycle through several images when the user clicks 2 arrows. I’ve linked the CodePen page below so you can see the code and what im trying to do.
https://codepen.io/Nomad89/pen/oRmpez
The problem I’m having is that this seems to only change the image once, then it stops working. Could someone explain what I’m doing wrong?
I’m using the number counter as a sort of visual cue to make sure it goes up and down depending on which arrow you click.
I understand that my JS is probably a bit longwinded for what I want it to do, but I figure this is something I’ll eventually change when I have a better understanding of JS.
Thanks all.