LazyLoading script to add to any website for improving performance.
Uses InspectionObserver API to track images and the viewport to load the images in a lazy manner.
- Add the script to the index of your website
- Change the
src
tag todata-src
for the images that you want to lazy load. - Reload and track the network logs in the dev-tools of your browser to see the results.
Note: Use web.dev to see the performance of your website/web-app.