I have a page with many square images (same width and height) where size is controlled with width:50%. They will be lazy loaded with lozad.js (https://www.npmjs.com/package/lozad) that uses IntersectionObserver. The problem is that IntersectionObserver will compute all images are visibility since the height is 0 (or unknown) and all images will be loaded immediately. I'll like to set the height the same as the width but cannot see how this is possible!?
<img class="lozad" style="width:50%;" data-src="1.jpeg">
<img class="lozad" style="width:50%;" data-src="2.jpeg">
<img class="lozad" style="width:50%;" data-src="3.jpeg">
<img class="lozad" style="width:50%;" data-src="4.jpeg">
<img class="lozad" style="width:50%;" data-src="5.jpeg">
<img class="lozad" style="width:50%;" data-src="6.jpeg">
.
.
.
.
<img class="lozad" style="width:50%;" data-src="99.jpeg">
<img class="lozad" style="width:50%;" data-src="100.jpeg">