Home Forums WoodMart support forum Lazyload images from mega menu Reply To: Lazyload images from mega menu

#212796

Artem Temos
Keymaster

Try to replace the JS code part with the following

jQuery('.whb-navigation li').hover(function() {
    jQuery(this).find('.woodmart-lazy-load-custom').each(function() {
        var $img = jQuery(this);
        $img.attr('src', jQuery(this).data('wood-src'));
        $img.addClass('woodmart-loaded');
        var $categories = $img.parents('.categories-masonry');
        if ($categories.length > 0) {
            $categories.imagesLoaded(function() {
                $categories.packery();
            });
        }
    });
});