Hi all,
When we were using images in Javascript,it is a good thing to preload it before we use it.
This can be achieved by using following code
jQuery.preloadImages = function()
{
for(var i = 0; i”).attr(“src”, arguments[i]);
}
};
// Usage
$.preloadImages(“image1.gif”, “/path/to/image2.png”, “some/image3.jpg”);
Note:To show the scenario i have hotcoded static paths of image.