document.addEventListener("DOMContentLoaded", function (event) { setTimeout(function() { document.querySelectorAll('*').forEach.call( document.querySelectorAll('img[data-src]'), function (img) { img.setAttribute('src', img.getAttribute('data-src')); img.onload = function () { img.removeAttribute('data-src'); }; }); },200); });