WooCommerce lazyload breaking masonry grid

23 Views Asked by At

After activating the WooCommerce lazyload feature, the jQuery Masonry grid on the shop page is no longer working properly.

Is there some event triggered by WooCommerce's lazyloading which I can piggyback on and in turn trigger a reload of the masonry grid?

It seems like many people have run into this issue but I have yet to find an accepted solution.

I'm loading the grid in a standard way like this:

const $grid = $( '.products' );
        $grid.imagesLoaded( function() {
            $grid.masonry( {
                itemSelector: '.product',
                columnWidth: '.product',
                percentPosition: true,
                gutter: 32,
            } );
        } );

The problem can be seen at https://lasala.art/gallery

Thanks!

0

There are 0 best solutions below