versus
05-05-2004, 05:44 AM
The javascript works with IE mac and PC, and Mozilla on PC.
I can't find anyone who has documented quirks like this.
Lend me a hand if you can. Thanks!
________________________
Call this function on any page with images. It'll track whether they've loaded.
function progress() {
doneLoaded = 0;
fraction = 100/(imgDivs.length + 1);
for (var i = 0; i < document.images.length; i++) {
img = document.images[i];
// alert(i);
if (img.complete == true) {
alert('img#_' + i);
doneLoaded += fraction;
}
}
if (doneLoaded < 100) { setTimeout( "progress()", 100); }
}
____________________________________
see the script in action:
http://www.the-coup.org/portfolio.html
if all images aren't loaded, the script begins again from zero, but takes no time to catch up to where it left off.
I use this in conjunction with another script that displays the progess of loading.
script with alerts for debuggin
http://www.the-coup.org/portfolio2.html
(12 imgs, might loop twice, but not infinitely...promise)
I can't find anyone who has documented quirks like this.
Lend me a hand if you can. Thanks!
________________________
Call this function on any page with images. It'll track whether they've loaded.
function progress() {
doneLoaded = 0;
fraction = 100/(imgDivs.length + 1);
for (var i = 0; i < document.images.length; i++) {
img = document.images[i];
// alert(i);
if (img.complete == true) {
alert('img#_' + i);
doneLoaded += fraction;
}
}
if (doneLoaded < 100) { setTimeout( "progress()", 100); }
}
____________________________________
see the script in action:
http://www.the-coup.org/portfolio.html
if all images aren't loaded, the script begins again from zero, but takes no time to catch up to where it left off.
I use this in conjunction with another script that displays the progess of loading.
script with alerts for debuggin
http://www.the-coup.org/portfolio2.html
(12 imgs, might loop twice, but not infinitely...promise)