Answers for "js preload image"

2

preload images javascript

<script>

/*
Preload images script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}


//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
preloadimages("http://mydomain.com/firstimage.gif","http://mydomain.com/secondimage.gif","http://mydomain.com/thirdimage.gif")

</script>
Posted by: Guest on February-25-2020

Browse Popular Code Answers by Language