JavaScript: Grid in Tabs
< 1 min read
For those experiencing trouble with the Grid type format not showing up in your tab type widget this post is for you. Some themes and plugins have tabs that do not allow some javascript type functions to fire properly. Using the js below should help correct that issue. You will need to place this custom js under our Custom JS option.
Replace the class .yourClass with your navigations tab class name. We realize this may not fit your exact requirement and you'll need to change a few things around in the code below if you are not using a ul list in your tabs. However, this is a good starting point to search for other answers on the web should this one not work. The idea here though is we want to set a timeout function so we can trigger a window resize which in turn will make the images show up properly.
jQuery(window).on('load',function(){ jQuery( ".yourClass" ).click(function() { setTimeout(function() {jQuery(".masonry").masonry("layout");}, 200);} }); });