0
Image slider not working. I can't seem to get this code to work. Help please.
6 Answers
+ 1
added a comment in the code where i made a change. hope u get it now.
https://code.sololearn.com/W9V6BKIq2NlW/?ref=app
+ 1
1) you missed single quote in two places namely
<img src= 'some link' alt=''/>
inside your script:- var imageSource = []
2) it's document.getElementById() and not document.getElementByID()
check line:- 22 26 32 in your code
https://code.sololearn.com/Wlgcxh04fRKJ/?ref=app
Here is the corrected version of your code.
+ 1
Check at line 41
It should be
x = imageSource.length -1
inside function prevBtn()
// some code here
if(x<0){
x = imageSource.length-1
}
//some code here
+ 1
Thank you for your time Niththish , all my issues have been solved.
0
Thank you Niththish . I still have one more problem though. I can't seem to make the "prev" button reset the image to the last image in the array when the current image is the first image. Please reference the modified code I wrote. Thank you.
0
Niththish , that doesn't seem to work for me. I have tried and it doesn't. Could you implement it into a code like you did the first?