• Hi Florian,

    Could you help me out figure out why the following background-image is loading instantly?

    Leaf_cszwry.png. It is the back-image of Our Service section.

    Here is how I set it up:
    <div class="background-image home-banner-cover services-banner-cover banner-content-height lazyload" style="" data-bg="<?php echo $home_image_object['url']; ?>">

    Thanks

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

Viewing 7 replies - 16 through 22 (of 22 total)
  • Thread Starter Stefano Monteiro

    (@stemon)

    Hey Florian,

    I sent the email to [email protected]

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi @stemon,

    yes, that is correct. But I use Gmail as a provider with my cusotm domain, and they block emails that contain .js files in attachments (https://support.google.com/mail/answer/6590). So if you sent the theme directly as an attachment and did not upload it to Dropbox or something like that, the email would be blocked by Gmail.

    Best,
    Florian

    Thread Starter Stefano Monteiro

    (@stemon)

    Got it. Just emailed you again with links to dropbox.

    THanks

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hey @stemon,

    I am sorry but I did not recieve a message. ?? If you want (and I would totally understand if you don’t want to make another try), could you try the share option of dropbox so I get a email from Dropbox linking to your folder? Maybe my account has some problem with your email provider, I don’t know.

    Thanks,
    Florian

    Thread Starter Stefano Monteiro

    (@stemon)

    Absolutely, dont feel bad for helping ??

    I just shared directly from dropbox. Let me know if it worked otherwise we see another way.

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    That worked, got the email, thanks! ??

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi @stemon,

    I finally found the time to take a look at it. What I noticed: the inline script for adjusting the threshold did not work like I wrote in the post. I modified it a bit and this worked from the functions.php:

    
    function slug_enqueue_lazysizes_options() {
    	wp_add_inline_script( 'lazysizes', 'window.lazySizesConfig = window.lazySizesConfig || {}; lazySizesConfig.expand = 1;', 'before' );
    }
    add_action( 'wp_enqueue_scripts', 'slug_enqueue_lazysizes_options', 50 );
    

    After setting it to 1, the image got not lazy loaded before being on the second section in my tests (somehow it did, I don’t know if that has something to do with the case that the image was in my cache).

    Could you give that a try?

    Thanks,
    Florian

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Background Image loads instantly’ is closed to new replies.