-
-
Save mathieu-aubin/7154f81570c215e55c09fa97b93d4536 to your computer and use it in GitHub Desktop.
Alternate to lowsrc.
usage:
<img src="lowres.jpg" data-src="highres.jpg" />
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
/** | |
* Laod large image at last. | |
* requires jQuery | |
* @author: takien | |
*/ | |
jQuery(document).ready(function($){ | |
$('img').each(function(){ | |
var hires = $(this).data().src; | |
if((hires != undefined) && (hires != '')){ | |
$(this).attr('src',hires); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment