jquerytabsresizewindow-resize

jQuery window resize on tabs


I've got a masonry image grid within 2 tabs (so 1 masonry grid within each tab content area). The common issue i'm having is switching between tabs is messing up the grid because of a window resize issue.

You can see working example here: http://www.gomy5.co.uk/our-work-copy/

I'm currently trying .resize on tab click, but it's not working correctly.

$(".tab-link").click(function(){
    $('#tab-1').resize();
    $('#tab-2').resize();
});

Any ideas why it's not re-sizing the tabbed content area correctly?

Thanks


Solution

  • I couldn't find a working jQuery solution. So i've found a css based one. Instead of using

    display:none
    

    and the dimensions not being set on hidden elements. I changed and used

    visibility:hidden;
    visibility: visible;
    

    This seems to have solved the problem.