Skip to content

Instantly share code, notes, and snippets.

@ZaneHannanAU
Last active July 16, 2016 13:19
Show Gist options
  • Save ZaneHannanAU/2a46aa6fd659cd091592c66606fc05c1 to your computer and use it in GitHub Desktop.
Save ZaneHannanAU/2a46aa6fd659cd091592c66606fc05c1 to your computer and use it in GitHub Desktop.
// Grab all images
for(i=0;i<document.images.length;i++)
{
// if document.images[i].getAttribute("data-src"){ // If there's a "data-src" attribute on them
document.images[i].src = document.images[i].getAttribute("data-src"); // Set the src value to that of the data-src value
document.images[i].style.visibility = "visible";
document.images[i].style.opacity = 1;
// }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment