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 355 forks source link

Background images data-src-small #172

Closed mikeziri closed 5 years ago

mikeziri commented 5 years ago

Having data-src-small alongside data-src doesn't seem to trigger different background-image (urls) based on window size.

Looking at the code I can clearly see it is not being used as it simply sets the background-image url with src. would be excellent if you could add the logic used on to select the appropriate src.

I tried to understand how it is calculated but the handleSources simply sets the attributes, doesn't choose based on the window size.

ty, and keep up the great work.

mikeziri commented 5 years ago

After further investigation, I found that I need to set the breakpoints (there aren't any defaults) and also, I must use a real mobile device or emulate in browser because window size is not taken into account, device size is.