I'm currently working on creating a lightbox feature and have reached the stage where I am implementing next and previous buttons to navigate through images. I am utilizing console.log
to check if the correct href
is being retrieved when the next button is clicked.
My current challenge is using a JavaScript variable instead of an HTML identifier within a JQuery selector. While I've come across information indicating this is possible here, encountering syntax errors upon clicking next
.
The main objective is to display the next or previous image in the lightbox whenever the next or prev (once implemented) buttons are clicked, respectively.
Your assistance in resolving this issue would be greatly appreciated!
(For better visualization, please view the code snippet in full screen mode)