Easy Lazy
Based on Robin Osborne's lazy loading technique. This is an ES6-updated alternative with configuration options.
Use
const lazy = lazy // Or use default configuration...
Configuration
Lazy() accepts a configuration object with the following properties.
className (default: 'js-lazy')
The class name of the images to lazy load.
attrSrc (default: 'data-src')
The attribute where the image src lives.
Transition
Adding a transition is easy using the .loaded
class.
Here is a simple fade in: