Skip to content

Instantly share code, notes, and snippets.

@navio
Created August 9, 2016 02:44
Show Gist options
  • Save navio/e48f1e2b847beaacb556fba0fab671dd to your computer and use it in GitHub Desktop.
Save navio/e48f1e2b847beaacb556fba0fab671dd to your computer and use it in GitHub Desktop.
LazyLoad basic Replace.
(function(){
var initImages =
function(node,selector){
var images = node.querySelector(selector);
[].foreach.call(images,function(el){
el.src = el.attr('data-lazyload');
el.classList.remove(selector);
});
};
return function(){
initImages(document,'bc-lazy-load');
return initImages;
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment