Skip to content

Instantly share code, notes, and snippets.

@jonluca
Last active March 23, 2018 01:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonluca/fc74d3a0728ec5349699752947792c31 to your computer and use it in GitHub Desktop.
Save jonluca/fc74d3a0728ec5349699752947792c31 to your computer and use it in GitHub Desktop.
Lazy Load
$(document).ready(function() {
$("#about").click(function() {
$('#about > .lazyload').each(function() {
// set the img src from data-src
$(this).attr('src', $(this).attr('data-src'));
});
});
$("#articles").click(function() {
$('#articles > .lazyload').each(function() {
// set the img src from data-src
$(this).attr('src', $(this).attr('data-src'));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment