/ Published in: JavaScript
Preloads a list of difined images to the browser cache
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- if (document.images) { preload_image_object = new Image(); // set image url image_url = new Array(); image_url[0] = "http://mydomain.com/image0.gif"; image_url[1] = "http://mydomain.com/image1.gif"; image_url[2] = "http://mydomain.com/image2.gif"; image_url[3] = "http://mydomain.com/image3.gif"; var i = 0; for(i=0; i<=3; i++) preload_image_object.src = image_url[i]; } //-->