This time I will share jQuery Plugin and tutorial about jQuery Plugin To Lazy Load Images While Scrolling – Lazyload, hope it will help you in programming stack.
Lazyload is a jQuery plugin to speed up the initial page load time by delaying the load of background images until they are scrolled into view.
Features:
- Loading spinner.
- Fallback for error image.
- Custom placeholder image.
- Supports both images or background images.
How to use it:
1. Place the jQuery Lazyload script after jQuery JavaScript library.
1 |
< script src = "//code.jquery.com/jquery-1.11.3.min.js" ></ script > |
2 |
< script src = "lazyload.js" ></ script > |
2. Add background images to your containers using dataimg
attribute.
1 |
< div class = "lazy" dataimg = "1.jpg" > |
3. Call the plugin and done.
4. Options and defaults.
This awesome jQuery plugin is developed by singod. For more Advanced Usages, please check the demo page or visit the official website.