Created
August 15, 2015 16:35
-
-
Save panoply/d41383cd229d2c02e01f to your computer and use it in GitHub Desktop.
Tictail - Image src resize in mobile
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
// # Tictail Product Image resize | |
// | |
// Use on themes that dont use the "mobile optimized layout" feature on tictail. | |
// The code resizes the products <img src=""> to lower resolution images. | |
// When document is ready preform the following actions: | |
// | |
$(function () { | |
if (window.matchMedia("(max-width:768px)").matches) { | |
$('.lazy').attr('data-original',function(i,e){ | |
return e.replace("size=500","size=300"); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment