Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Lazy load images or delay them. Put this in the middle or end of <body> for 99.9% efficiency.

View imgs-delayed-lazyload.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
(function(){
var imgs = document.getElementsByTagName('img');
var l = imgs.length;
if (l<=0) return;
var srcs = [];
for (var i=0; i<l; i++){
var img = imgs[i];
srcs.push(img.src);
imgs[i].removeAttribute('src');
}
setTimeout(function(){
for (var i=0; i<l; i++){
imgs[i].src = srcs[i];
}
}, 5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.