With pictures being many of the maximum famous forms of content material on the webpage load time on websites can without difficulty end up an issue. Even though the whilst are well optimized, pictures can weigh pretty a bit.
Lazy loading pictures manner loading pictures on websites asynchronously, after above the fold content is completely loaded, or maybe conditionally, best once they seem within the browser’s viewport.
There are multiple super motives why you must don’t forget lazy loading pictures to your website:
Make a faster loading webpage
1. Native lazy loading
Lazy: Works wonderfully for lazy loading.
Eager: Instructs the browser to load the desired content material proper away.
Auto: Leaves the choice to lazy load or not lazy load as much as the browser.
2. Lazy loading using the intersection observer API
The intersection observer API is a contemporary interface that you may leverage for lazy loading pictures and different content. Notice how the route to the picture is contained inner an information src characteristic, not an src characteristic.
4.Lazy loading with bolurred image
The first element you notice is a blurred, low-decision replica of the picture, even as its high-res model is being lazy loaded you can lazy load pictures with this blurring impact in some of the methods.
Support for retina screens.
Yall is a feature-packed, lazy-loading script for pictures, videos, and iframes. More specifically, it makes use of the intersection observer API and falls lower back on conventional occasion handler strategies wherein vital.
You upload the magnificence lazy to the detail.
The cost of src is a placeholder picture.
The route to the picture you need to lazy load is withinside the information src characteristic.
There you’ve got five methods of lazy loading pictures you may begin to test with and check out to your projects.