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) • 300 B
JavaScript
import{loadNative as o}from"./load.js";import{setToLoadCount as e}from"./counters.js";const t=["IMG","IFRAME","VIDEO"],r=o=>o.use_native&&"loading"in HTMLImageElement.prototype,a=(r,a,m)=>{r.forEach((e=>{-1!==t.indexOf(e.tagName)&&o(e,a,m)})),e(m,0)};export{a as loadAllNative,r as shouldUseNative};