• Resolved ferra_andre

    (@ferra_andre)


    Hi,
    I noticed that the images set as background in CSS are downloaded twice, once when the page loads and again when the page scrolls.

    if I set the image url in the background-image-backup tag everything works fine, but I would use style = “background-image: url (…)” ad usual.

    thanks!

    https://www.ads-software.com/plugins/wp-image-lazy-load/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Radek Mezulanik

    (@zedna)

    Hi,
    no element is loaded twice when it has been already loaded. If you can see background-image-backup, your bg image has been loaded and script will not remove & load it anymore.

    Do you have some live example of your issue?

    Thanks
    zedna

    Thread Starter ferra_andre

    (@ferra_andre)

    hi,
    here you can see the problem on the live site: https://vienievedi.net/testimonianze/

    here a screenshot of the Dev Tools: https://infinit.io/_/5TQVxkp.png

    thanks!

    Plugin Author Radek Mezulanik

    (@zedna)

    You have 11 elements with background image, so plugin went through all of them and repeat function 11 times.

    (e.g.
    .immagine-evidenza .immagine{background-size:cover;background-position:center center;position:relative;)

    It′s possible, that some other plugin is affects this plugin(Better WordPress Minify?). Try to disable other plugins and check if something changed.

    Thread Starter ferra_andre

    (@ferra_andre)

    I don’t understand what is the problem having 11 background images.
    I disabled plugins, cache etc, but nothing has changed..

    with images works fine, the problem is with background images

    tranks

    Plugin Author Radek Mezulanik

    (@zedna)

    THe problem is, that if you have 11 background images, the script will load 11x times ??

    Thread Starter ferra_andre

    (@ferra_andre)

    the plugin repeats the function whenever it finds an image, but it should not download it twice, or I am wrong?

    in my case the images are downloaded when the page loads and after the page scrolls

    thanks for your patience ??

    Plugin Author Radek Mezulanik

    (@zedna)

    It is not downloading twice, but you have one background image twice on the page. If it′s downloaded once, plugin will skip it next time, no matter if you scroll or not.

    Thread Starter ferra_andre

    (@ferra_andre)

    I’m sorry, but only one image is repeated twice in the page code, the others not.
    have you see the screenshot of the dev tools? https://infinit.io/_/5TQVxkp.png

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘background-image are downloaded twice’ is closed to new replies.