image.complete and animated GIFs

M

Mark Anderson

Further to the earlier thread on detecting if images have loaded I'm
using this function, called from body's onLoad event:

function preloadImgWait(){
alert('checking');
if (!document.images["billboard"].complete) {
setTimeout("preloadImgWait()", 500);
} else {
alert('loaded');
var ele, eleID = 'Layer2';
if (document.getElementById) {
ele = document.getElementById(eleID);
if (ele && ele.style) {
ele.style.visibility = 'hidden';
ele.style.left = '-1000px';
}
}
else if (document.layers) {
ele = document.layers[eleID];
if (ele && typeof(ele.left)!='undefined') {
ele.visibility = 'hide';
ele.left = -1000;
}
}
}
}

"Layer2" is a DIV with a message 'loading...' which 'covers' DIV
"Layer1" which is loading a large animated GIF - in (not my design
choice - so not for change). Anyway in IE 6(win) and 5.2(Mac) show both
alerts and reveal Layer1. But NN4.7 (Mac OS9) and Safari 1.2, load all
page elements and hang. NN4.7 alerts on checking and then hangs with
Layer2 still visible (I can't see Layer one to tell if images has
loaded). Safari 1.2 just loops with the checking alert and I have to
force quite the app. [For anyone following from the earlier thread I
moved the inline styles out of the DIV into a style block in the page
head.] Sorry I can't point you at the page to see the effect and full
code - not my call.

What have I overlooked?

Regards

Mark Anderson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top