• Resolved V.E.L

    (@vezraimanuel)


    Hi!!

    is it okay if I remove this?
    <noscript><style>.lazyload{display:none;}</style></noscript>

    W3c validator yields error on that section.

    thank you! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    sure, you’re allowed to do anything you want on your own site V.E.L ??

    Thread Starter V.E.L

    (@vezraimanuel)

    @optimizingmatters

    Thanks!!

    this is what i did:

    add_filter( 'autoptimize_filter_imgopt_lazyload_cssoutput', '__return_false' );
    add_action( 'wp_head', function() { echo '<style>.lazyload,.lazyloading{opacity:0;}.lazyloaded{opacity:1;transition:opacity 300ms;}</style>'; }, 2147483647 );

    please let me know if you have suggestion about how to do it properly.

    many thanks!

    • This reply was modified 5 years, 5 months ago by V.E.L.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I would suggest doing something like

    
    add_filter( 'autoptimize_filter_imgopt_lazyload_cssoutput', 'nonoscript_lazyload');
    function nonoscript_lazyload($in) {
       return str_replace( '<noscript><style>.lazyload{display:none;}</style></noscript>', '', $in ) ;
    }

    warning: didn’t test this (no time now), but you’ll get the idea ??

    frank

    Thread Starter V.E.L

    (@vezraimanuel)

    Hi @optimizingmatters

    thanks! that works too

    but i had to remove autoptimize_filter_imgopt_lazyload_cssoutput and add the style to <head> because W3C validator returns error when we load <style> inside body

    many thanks!, cheers ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove noscript style’ is closed to new replies.