Support » Plugin: Lazy Loader » Lazy Loading with Hover

  • Resolved Andrei

    (@andrei0luca)


    Hi Florian,

    I was reading the plugin description on GitHub. In this chapter it is mentioned that it

    detects any changes to the visibility of any current and future image elements automatically no matter whether it becomes visible through a user scroll, a CSS animation triggered through :hover

    So I gave it a try lazy loading an image that is visible through :hover. I added class "lazyload" and data-src=. Unfortunately Lazy Loader loads the image from the server after hover and not before hover (tested with DevTools – Network).

    I would like to know if this is Lazy Loader normal behaviour and these are the limits. Or if I am doing something wrong here and can be fixed.

    My test page is here. If you hover the “Analyses” element it will load an image named “Test2”.

    Thank you,
    Andrei

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi Andrei,

    I don’t think that lazysizes can detect if a user will hover over an image in the next moment. Loading it on hover (like it happens on your site for me) is the correct behavior, I think. »Future image elements« means images that are added to the DOM after page load, I guess.

    Best,
    Florian

    Andrei

    (@andrei0luca)

    Hi Florian,

    I am not sure in what scenario Lazy Loader would

    detect (…) future image elements automatically (…) no matter whether it becomes visible (…) through :hover

    If it does not work with :hover then this part of the plugin description might need a little more clarity 🙂

    Thank you for the support,
    Andrei

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi Andrei,

    I don’t understand what you mean, sorry. It works with hover (at least in my test): the test2.jpg is loaded when you hover the element, not before. And that is exactly what I would expect 🙂

    Best,
    Florian

    Andrei

    (@andrei0luca)

    Indeed, you are right.

    Thank you,
    Andrei

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    You’re welcome 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.