intersection-observer-v2
v1.0.0
Published
lazyloading images, iframes and videos with intersection observer 2
Downloads
12
Maintainers
Readme
lazyloading images, iframes and videos with intersection observer
Credits to https://github.com/vivek11432/Intersection-Observer-v2 for the basecode
demo here: https://thomaswt.github.io/Intersection-Observer-v2/
Examples of elements at the bottom
No jQuery required
Video element
<video class="lazy" height="auto" preload="none">
<source data-src="http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4" type="video/mp4">
</video>
Iframe element
<iframe data-src="https://www.w3schools.com"></iframe>
Multiple images entering the viewport
<img style="display:inline-block;" data-src="/img/myimg.jpg">
<img style="display:inline-block;" data-src="/img/myimg2.jpg">