0
JS: code help
I’m in the process of making an image slider. With next and previous buttons. I had the next button working just fine. And then I added the “previous” button. Still worked fine. The problem is when you click next and get to 9:8 (console) I tried to change numbers around and tried to figure out, but not sure what’s happening. https://code.sololearn.com/WVFKv0ICtAd8/?ref=app
2 Respostas
+ 1
Replace lines 21 and 22 with "else".
+ 1
if(i > 9){
i = 0;
x = 9;
}
else
if(i == 1){
x = 0}
else
if (i <= 9){
x = i - 1;
}