[-] Add caption content to the Gallery Block

If you want to have the caption showing in the actual lightbox when using a Toolset Gallery Block, then you could add the snippet below.

jQuery(document).ready(function(){
jQuery('div.tb-brick__content').each(function(){
var caption= jQuery(this).find('.tb-gallery__caption').html();
jQuery(this).find('a').attr('data-title',caption);
});

});

What it does is that it will get the content of the caption that toolset added to the Image and will create a custom attribute that will allow the Lightbox to show the caption when you click an image of the gallery.


Let us know if this snippet is not working for you:

This snippet doesn’t work
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments