src/js/lazy-load.js
// Preload image in browser's cache
Preload image in browser's cache
Preload image in browser ' s cache
function preloadImage (image) {
  var url = image.dataset.src;
  if (!url) {
    return;
  }
  var img = new Image();
  img.src = url;
  applyImage(image, url);
}
function preloadImage ( image ) { var url = image . dataset . src ; if ( ! url ) { return ; } var img = new Image ( ) ; img . src = url ; applyImage ( image , url ) ; }
Preload image in browser's cache
Preload image in browser ' s cache
// Get url from data-src attribute // Built-in image object // Preload image // Apply image