How to load webpage faster having large number of images

|
| By Webner

If your webpage has a lot of images it may load really slowly. We can use jQuery method lazyLoad to load the page faster. Lazy Load delays loading of images in long web pages. Images outside of viewport (means part of the screen you are viewing) are not loaded until user scrolls to view those images. Using Lazy Load on long web pages will make the page load faster resulting in less load on the server.

How to use LazyLoad:

Include at the end of the HTML.

<script src="jquery.js"></script>
<script src="jquery.lazyload.js"></script>

Give the same class to all the images which you want to lazily load.

Example:

<img class="lazy" alt="" width="640" height="480" />
$(function()
{
$("img.lazy").lazyload();
});

Leave a Reply

Your email address will not be published. Required fields are marked *