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

Blazy visibility determination, max-width and max-height #157

Open hannasm opened 6 years ago

hannasm commented 6 years ago

I have created a fiddle demonstrating the issue here: https://jsfiddle.net/8us8m1wb/1/

Using a css style with "max-height: 0; overflow:hidden" is an effective way to hide an tree in the page in a way that can be animated through css transitions.

I am using the 'container' feature as well. The parent container has max-height:0 (or max-width) and the child element is not displayed, but blazy still loads it.

Checking the width and height of the rect fixes this issue