Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created October 31, 2012 13:43
Show Gist options
  • Save gavinblair/3987105 to your computer and use it in GitHub Desktop.
Save gavinblair/3987105 to your computer and use it in GitHub Desktop.
replace which folder to grab img src's from
//responsive images
retina = window.devicePixelRatio > 1 ? true : false;
var l = "l";
if(retina) {
$("html").addClass("retina");
l = 'h';
$('img').each(function(){
$(this).attr("src", $(this).attr("src").replace("/l/", "/h/"));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment