I have the following html markup generated through php:
<a href="pic/img1.jpg" data-lightbox="gallery1" data-title="gallery1">
<div class="img-wrap">
<img src="pic/thumbs/img1.jpg"><span class="caption">Gallery1</span></a>
</div>
<a href="pic/img2.jpg" data-lightbox="gallery1" data-title="gallery1"></a>
<a href="pic/img3.jpg" data-lightbox="gallery1" data-title="gallery1"></a>
<a href="pic/img4.jpg" data-lightbox="gallery1" data-title="gallery1"></a>
<a href="pic/img5.jpg" data-lightbox="gallery1" data-title="gallery1"></a>
<a href="pic/img6.jpg" data-lightbox="gallery1" data-title="gallery1"></a>
<a href="pic/img7.jpg" data-lightbox="gallery1" data-title="gallery1"></a>
The issue i'm having is that when clicking on the thumbnail, the lightbox loads img1 in position 2 of 8, and pressing back in the lightbox brings another copy of img1. I'm thinking it's due to light box including the thumbnail img as well as the full size one.
Any quick and easy solutions to this??
It appears that your HTML is invalid. You've got:
I suggest: