// Set the title
if(link.attr('title')){
var titleWrap = $('<span>', { 'class': 'lightbox-title' });
titleWrap.text(link.attr('title'));
$('.lightbox-title-wrap').html(titleWrap);
} else {
$('.lightbox-title-wrap').html('');
}
},
Using this jquery, my captions are being pulled from the title attribute of my images:
<a href="img/LargeImage.jpg" class="lightbox" title="Image Caption Here">
<img src="img/Thumb.jpg" ></a>
This does not allow for HTML captions (i.e. adding a Facebook Like button for every image when in the Lightbox).
I’m looking for a way to pull the caption based on the div class, similar to this:
<a href="img/LargeImage.jpg" class="lightbox" title="ImageCaption1">
<img src="img/Thumb.jpg" ></a>
<a href="img/LargeImage.jpg" class="lightbox" title="ImageCaption2">
<img src="img/Thumb.jpg" ></a>
<a href="img/LargeImage.jpg" class="lightbox" title="ImageCaption3">
<img src="img/Thumb.jpg" ></a>
<div id="ImageCaption1" class="html-caption">
This is my caption for image 1
</div>
<div id="ImageCaption2" class="html-caption">
This is my caption for image 3
</div>
<div id="ImageCaption3" class="html-caption">
This is my caption for image 3
</div>
Any suggestions?
Thank you!