0

I've been banging my head against a lot of walls recently and I can't find any working answers (even with this solution that I might not understand).

I'm using masonry on div(class="box") and I'm trying to put those divs into bootstrap tabs.

The problem is : the reload doesn't work well, leaving gap and acting like the last divs are not cleared.

I've tried this :

$('a[data-toggle="tab"]').on('shown', function (e) {
            $('#content').masonry( 'reload' );
        });

But it's of course not working. Please help

Community
  • 1
  • 1
Pretty Good Pancake
  • 1,423
  • 3
  • 12
  • 28

1 Answers1

3
$('a[data-toggle=tab]').on('shown.bs.tab', function (e) {
    $(window).trigger("resize");
});
$(window).resize(function(){
    $this = $('#content');
    $coloumn = $this.width() / 4;
    $this.masonry({ columnWidth: $coloumn, gutter: 0, itemSelector: '.content_block_row_wrap' });               
}); 

I fixed similar problem with a similar of this code. Live demo: http://shop.theme.firmasite.com/premium-features/ Check its codes.

Ünsal Korkmaz
  • 224
  • 4
  • 17