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 Answers
+ 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