Closed chenkun24 closed 8 years ago
hey @chenkun24
Yes thats how getBoundingClientRect works. Instead of adding display:none to your container/image you could maybe use visibility: hidden or set height and width to zero? In that way it wont load on page load but first when it's inside the viewport.
Closing it since it's a browser behavior. The browser doesn't bother rendering hidden items at all why getBoundingClientRect etc just returns zero
When an element is hidden, 'getBoundingClientRect' does not work, and images will load when the page was loaded. Is it a bug? Is there any way to load hidden images while scrolling?