L
littleark
Hi everybody,
I have a typical javascript images preloader, it works fine both on
Firefox and on IE in my intranet (local server).
It works fine on the Internet (remote server) in IE.
In Firefox it stops before loading every image.
Does image.onload function have some problems with little images?
Any ideas? I suppose there's another post with the same topic, if so
could you please give me the link?
Thank you in advance,
carlo
This is the function:
// images is an array of images name
function preloadImages(images) {
var imgPreload=new Array();
var total=images.length;
var now=0;
for(i=0;i<images.length;i++) {
imgPreload=new Image();
imgPreload.onload=function() {
now++;
if (now==total)
alert("OK!");
}
imgPreload.src = images;
};
}
I have a typical javascript images preloader, it works fine both on
Firefox and on IE in my intranet (local server).
It works fine on the Internet (remote server) in IE.
In Firefox it stops before loading every image.
Does image.onload function have some problems with little images?
Any ideas? I suppose there's another post with the same topic, if so
could you please give me the link?
Thank you in advance,
carlo
This is the function:
// images is an array of images name
function preloadImages(images) {
var imgPreload=new Array();
var total=images.length;
var now=0;
for(i=0;i<images.length;i++) {
imgPreload=new Image();
imgPreload.onload=function() {
now++;
if (now==total)
alert("OK!");
}
imgPreload.src = images;
};
}