Lazyload images with jQuery
npm install jquery.lazyload.cjsLazy Load delays loading of images in long web pages. Images outside of viewport wont be loaded before user scrolls to them. This is opposite of image preloading.
Using Lazy Load on long web pages containing many large images makes the page load faster. Browser will be in ready state after loading visible images. In some cases it can also help to reduce server load.
Lazy Load is inspired by YUI ImageLoader Utility by Matt Mlinac.
Lazy Load depends on jQuery. Here's how to include it (tested on webpack):
``js`
var $ = require('jquery')
require('jquery.lazyload.cjs')($)
then in your code do:
`js`
$("img.lazy").lazyload();
This causes all images of class lazy to be lazy loaded.
More information on Lazy Load project page.
You can install with bower or npm.
`sh``
$ npm install jquery.lazyload.cjs
All code licensed under the MIT License. All images licensed under Creative Commons Attribution 3.0 Unported License. In other words you are basically free to do whatever you want. Just don't remove my name from the source.