• Hello,
    We have WP-Rocket plugin, and when we activate the lazy loading option, the slider doesn’t work as it should.

    Only the first image is loaded, and the other two images are placed below and don’t load (is only a blank space below the first image, with the size of the other images). And only when we scroll, it shows ok.

    The slider we’re using is a carousel slider from visual composer, there’s a way to exclude the class from lazy loading? (in wp-rocket don’t have any option to exclude in lazy loading)

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi,

    You can try this:

    function rocket_lazyload_exclude_class( $attributes ) {
    	$attributes[] = 'disappear';
    
    	return $attributes;
    }
    add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );
    Thread Starter ncovello

    (@ncovello)

    Hello,

    No, that didn’t work (I added as a php snippet) also tried

    function rocket_lazyload_exclude_class( $attributes ) {
    	$attributes[] = 'class="disappear"';
    
    	return $attributes;
    }
    add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );

    and other classes

    Plugin Contributor WP Rocket

    (@wp_rocket)

    That indeed won’t work because the class is dynamically added to the image after the page is loaded.

    Currently the solution would be to prevent lazyload on the page(s) where you have this slider, using the example code in our FAQ.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘lazy loading on slider dont work’ is closed to new replies.