Open BMCwebdev opened 8 years ago
This is handled by the browser. I don't do anything special here. Currently chrome won't load a smaller image.
I'm not sure, but I think, that all other browsers will load the smaller one. I can't say, whether this has a reason. (Smaller image less memory usages etc.)
In case you think the browsers should handle this different, please file a bug report there:
In case you want to fully control this and you are using the data-sizes="auto"
feature, you can write something like this:
document.addEventListener('lazybeforesizes', function(e){
var width = parseFloat(e.target.getAttribute('sizes'));
if(width && width > e.detail.width){
e.detail.width = width;
}
});
Note: In this case you might improve things, but you take away the browsers ability to intelligently handle things differently.
Hi there. I cannot find the answer in the documentation, so I thought I'd come here to ask. When working with a non art direction image choice, is there an option for this scenario:
Thank you!