0
Why is the second event listener calling the next() function instead of the previous() function? 🧐
I’m trying to create a previous button for an image slider but the event listener is calling the next() function instead of the previous() function. Any ideas why this is happening? Here’s my code for reference: https://code.sololearn.com/Wa6a21a8A14a/?ref=app
2 odpowiedzi
+ 3
your <img> buttons are absolute positioned and next is above previous button, so only next button is accessible to click...
you should use margin instead of padding as quickest fix to position your buttons ;)
0
visph thank you for the explanation! it fixed the issue with my code