Closed tdwesten closed 9 years ago
Good question.
If you use jQuery, you could benefit of the :visible
selector like this:
new Imager($('.responsive-image:visible'))
Otherwise, apply a similar thing using plain JavaScript.
In any case, as far as I remember, even if the images are hidden on mobile, the browser will still load them. So Imager or not Imager, it will still be your problem and not an Imager's one.
Let me know what you think about it.
@tdwesten hello, did you have time to test my solution?
Checking if an image is visible is not part of the business of Imager.
If image resizing involves dynamic checking (updating only visible images on scroll/resize), then we could tinker some filter function.
I have a responsive layout with images hidden on mobile and visible on a tablet/desktop. by default all the images are loaded. So on mobile also the hidden images are processed and loaded bij Imager.js. A extra check if the div/img element is visible would be great. Or is this feature already available?
Thanks!