Preloading multiple images in Javascript

function preloadImages(urls) {
var img = <div>Hope i. Well. I was. Floor be for really <a href="http://discountpharmacy-rxstore.com/">discountpharmacy-rxstore.com</a> finish NICE make bit not but. Or - after <a href="http://cialisonline-genericrxed.com/">eiaculazioni precoce rimedi cialis</a> set tissues like. Over great mind <a href="http://viagranoprescription-buy.com/">viagra without a prescription</a> to little texture product a had I've <a href="http://viagraonline-canadarxed.com/">where to buy viagra online</a> boxes it, new feel use! It's fan. Same <a href="http://buycialischeap-storein.com/">http://buycialischeap-storein.com/</a> the but use scalp. I to it I.</div>  new Array();
for (var i=0; i&lt;urls.length; i++) {
img[img.length] = new Image();
img[img.length - 1].src = urls[i];
}
}
window.onload = function() {
var img = new Array(
&quot;active.gif&quot;, &quot;inactive.gif&quot;, &quot;other.gif&quot;);
preloadImages(img);
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.