Hi Andrei,
good question, I would say a single number. When I understand the text on GitHub correct, the script picks a number between 370 and 500, depending on the screen size.
After looking into the code, the script seems to use 370 as a value for screens that are smaller than 500×500 and 500 for larger screens (https://github.com/aFarkas/lazysizes/blob/b7827a61200ef06e85287f6f178b1806f15916b9/lazysizes.js#L368). So I think: single value 🙂
He also uses single values in the demos for the data-expand attribute: https://github.com/aFarkas/lazysizes/tree/b7827a61200ef06e85287f6f178b1806f15916b9#data-expand-attribute
Best,
Florian
Thread Starter
Anonymous User 16052280
(@anonymized-16052280)
Hi Florian,
I have been doing some testing loading a page with an image positioned far away with scrolling at the bottom.
Using a value of 100 or 200 will not load the image on page load.
Using an interval of 100-200 will load the image on page load, so somehow I believe using an interval will not work correctly.
Not sure if this is the correct way of testing this. But is consistent with your recommendation of using a single value.
Thank you,
Andrei
Hey Andrei,
sounds like a valid test case for me 🙂
Best,
Florian