desandro / masonry

:love_hotel: Cascading grid layout plugin
https://masonry.desandro.com
16.27k stars 2.11k forks source link

Items still overlapping with imagesLoaded and jquery's window on load #1158

Open UXMike opened 2 years ago

UXMike commented 2 years ago

$(window).on("load", function() { if ($(window).width() > 991) { $container.append('<div class="grid-sizer" style="width: 33.33%"></div>'); $container.imagesLoaded( function() { $container.masonry({ itemSelector: '.grid-item', columnWidth: '.grid-sizer', percentPosition: true }); }); $container.masonry('reloadItems'); $container.masonry('layout'); } }); });

Please find the live site with the issue below, the problem usually happens on first load but not consist. https://www.influxdigital.com/our-work

AnthonyIsBlacking commented 2 years ago

Did you find a solution for this? Please check if the issue was similar to what I'm experiencing https://github.com/desandro/masonry/issues/1161