I\'m trying to change the folder that my images are read from depending on the window width.
I have two folders that contain the different image sizes and I\'m wonde
I don't think waiting for DOM Ready (jQuery's $(document).ready)) is a good idea in this case. Better use plain javascript:
if (screen.width < 620) {
var imgs = document.getElementsByTagName("img");
for (var i = 0; i < imgs.length; i++)
{
imgs[i].src = imgs[i].src.replace("images/620x410/", "images/310x205/");
}
}
Paste it at the bottom of your body tag.