Star Follow @1000ch
GitHub 🚩 [Native lazy-loading for the web]( is introduced finally, so I recommend you to use [`loading` attribute]( instead. # lazyload-image [HTMLImageElement]( extension for lazy loading. Images will be loaded when they are shown. ## Install Install `lazyload-image` via npm. ```bash $ npm install lazyload-image ``` ## Usage Import `LazyloadImage` and register it. ```javascript import LazyloadImage from ''; customElements.define('lazyload-image', LazyloadImage, { extends: 'img' }); ``` Modify your `` elements such as following. ```html ``` ## Fallback If a browser does not support `customElements.define()`, images will be loaded as usual. ## License [MIT]( © [Shogo Sensui](