Reputation: 57
I'm creating an image gallery where you can click on thumbnails, and then the thumbnail image swaps with the big image in the gallery.
This all works out, after that you can click onto the big image and then the Bootstrap modal window will appear.
This also works out, but somehow the previous / next buttons aren't working. Meaning it should show the previous or next big image.
A demo can be found here: http://hosted.dehaanmedia.nl/resources/imagegallery/
The javascript can be found at fiddle
I think the problem is within line 23 var index = jQuery(this).parent('.bigimage img').index();
Upvotes: 2
Views: 1391
Reputation: 506
I changed the code to match your image path http://jsfiddle.net/p8vnrn59/3/ as you forgot to add the image name to the code as I advised you. in line 47
Your alert is working https://i.sstatic.net/t9TdI.jpg
note: there are some minor bugs that I'm certain you can fix; I'm now working and have no real-time to be arounf this fiddle.
Upvotes: 0