Tagged: Masonry Gallery
Hey guys- Good afternoon!
I’m running into what appears to be a bug in the loading of the masonry gallery. Link to page in private comments.
When the page loads if the user scrolls down quickly it appears that the calculation on the spacing doesn’t quite fire fast enough and some images become stacked on one another.
I’ve provided a link to screenshot in the private comments as well.
If I refresh or scale the page it recalculates and spaces them back out correctly.
We’ve tested the issue in Chrome and Safari. While it does it in both it seems to do so more consistently in chrome.
Thanks in advance for your help.
Hi,
Try adding this at the very end of your theme / child theme functions.php file:
function add_custom_script(){
?>
<script>
(function($){
$(window).load(function() {
$(this).trigger('resize');
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Regards,
Josue