UNPKG

vanilla-lazyload

Version:

LazyLoad is a lightweight (2.4 kB) and flexible script that speeds up your web application by deferring the loading of your below-the-fold images, videos and iframes to when they will enter the viewport. It's written in plain "vanilla" JavaScript, it leve

2 lines (1 loc) 258 B
const e=e=>{let t=[];for(let r,a=0;r=e.children[a];a+=1)"SOURCE"===r.tagName&&t.push(r);return t},t=(t,r)=>{const a=t.parentNode;a&&"PICTURE"===a.tagName&&e(a).forEach(r)},r=(t,r)=>{e(t).forEach(r)};export{t as forEachPictureSource,r as forEachVideoSource};