jQuery Plugin To Lazy Load Images While Scrolling Lazyload - Download jQuery Plugin To Lazy Load Images While Scrolling - Lazyload

Download jQuery Plugin To Lazy Load Images While Scrolling – Lazyload

Posted on

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.

jQuery Plugin To Lazy Load Images While Scrolling Lazyload - Download jQuery Plugin To Lazy Load Images While Scrolling - Lazyload
File Size: 8.8 KB
Views Total: 2445
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

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.

1 $("body").lazyload();

4. Options and defaults.

1 loadHidden: true,
2 interval: 200,
3 threshold: 3,
4 listCell:"lazy",
5 isImg:false,
6 placeAttr:"dataimg", // custom attribute that holds your images
7 errorImg: "",
8 container: null,
9 placeholder: null

This awesome jQuery plugin is developed by singod. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net