Lazy load images in JavaScript
Instead of placing the image's url in the src attribute, place it within a data attribute called data-url.
Then give all the elements you need to lazy load a class called "lazyload".
You can change the class name and data attribute in the config variable.
Call the lazyload method to load your assets.