Created
December 24, 2012 17:07
-
-
Save takien/4370033 to your computer and use it in GitHub Desktop.
Alternate to lowsrc.
usage:
<img src="lowres.jpg" data-src="highres.jpg" />
This file contains 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