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
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