dinbror / blazy

Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.
http://dinbror.dk/blazy
MIT License
2.63k stars 356 forks source link

fixed width container+ mobile #129

Open pruttned opened 7 years ago

pruttned commented 7 years ago

Hi, I have issue with images in long horizontal fixed width div in mobile browser (tested on chrome 54.0.2840.85 and also in chrome dev tools). Images are not loaded during horizontal scrolling even when they are in viewport. Only images at the beginning are loaded and other images only when the viewport is far pass them on the right.

I’ve created plunk with the issue http://run.plnkr.co/plunks/CsERqAApIppUzugTY8px/ (http://plnkr.co/edit/CsERqAApIppUzugTY8px) In order to reproduce, it is necessary to open dev tools and select any mobile device in the device toolbar (e.g. Nexus 5X). Then refresh the page.

Thanks.

dinbror commented 7 years ago

Hey @pruttned

You need to define the container on initialize: http://dinbror.dk/blazy/examples/#image-inside-container Sorry for the late reponse

pruttned commented 7 years ago

Hi. Thanks for your response, but I'm not using a scrolling container. It is just a wide row of images and whole window is scrolled. But it seems, that the problem is with getBoundingClientRect because it somehow returns constant result even when the windows is scrolled. So maybe it is bug in Chrome, or maybe I'm doing something terribly wrong :)

dinbror commented 7 years ago

@pruttned

ahh sorry about that. Do you still see the issue. Just tested in chrome 56.0.2924.87 and can't reproduce it.

pruttned commented 7 years ago

Hi, yes, I'm still able to reproduce this issue as you can see on the picture.

image

Thanks.

qbitza commented 6 years ago

Any work around for this?