adikahorvath
2/25/2014 - 1:50 PM

responsive images

responsive images

if (window.devicePixelRatio > 1) {
  var images = $('img');
  // console.log(images);
  
  images.each(function(i) {
    var originalImage = $(this).attr('src');
    var retinaImage = originalImage.replace(".", "@2x.");
    // var retinaImage = originalImage + "&density=2");
    
    $(this).attr('src', retinaImage);
  });
}