Created
August 9, 2016 02:44
-
-
Save navio/e48f1e2b847beaacb556fba0fab671dd to your computer and use it in GitHub Desktop.
LazyLoad basic Replace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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