So here's the problem,
I'm trying to load images using jQuery to speed up the page downloading. To accomplish it, I have the following code as an image, which I want to load after the page loads.
<img src="/pixel.png" new-img="/newimage.png"/>
Then, to load the final image after the document fully loads, I've used the following.
$(document).ready(function(){
$("img").attr("src", $("img").attr("new-img"));
});
This works fine for a single image, except I have multiple images that I want to convert to this. I'm completely stumped as when I try and load multiple images like this, it sets all the images to the last image loaded.
I'm not sure, but does '$(this)' have anything to do with it?
JSFiddle: http://jsfiddle.net/AeroMcDoom/8sxED/