Reputation: 31
I use Wordpress 4.2.2, Lightbox Plux Colorbox plugin, tabs plugin and native gallery.
I have a single page with 2 tabs. Each of the tabs contains its own gallery like that:
[tab title="Tab 1"]
[gallery link="file" columns="1" ids="1,2,3,4,5"]
[/tab]
[tab title="Tab 2"]
[gallery link="file" columns="1" ids="6,7,8,9,10"]
[/tab]
When I click on a thumbnail, lightbox pops up and it has all 10 pictures in it, despite that the gallery has only 5. The problem is that the pictures from both galleries appear in the same lightbox.
How can I have separate lightboxes for each gallery?
Upvotes: 1
Views: 478
Reputation: 31
Thanks for your massive support, folks. I solved the issue myself with this little js hack:
<script type="text/javascript">
$ = jQuery;
$(function(){
$('li.tab-pane').each(function(i, obj) {
var uid = $(this).attr('id');
$('#'+uid).find('a').attr('rel', 'lightbox['+uid+']');
});
});
</script>
Upvotes: 2