I have a tab section with a masonry element in each tab. The content height for the tabs is set to “auto adjust to content.” But when I click “Load More” on the masonry element, the tab height doesn’t adjust and instead the additional loaded posts are hidden. I have to click to another tab and then go back to the original tab in order to see the additional posts. Any idea how to fix this?
Hey Bryan,
Thank you for the inquiry.
Please try to add the following script in the functions.php file. The script should resize the tab section after loading the masonry items.
function ava_custom_script_masonry_load_more()
{
?>
<script>
(function ($)
{
function g()
{
$(window).on('debouncedresize', function() {
if ($('.av-masonry-load-more').length) {
$(window).trigger('resize');
}
});
}
$(document).ready(function ()
{
g();
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'ava_custom_script_masonry_load_more');
Best regards,
Ismael
That worked perfectly, thank you!