Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- js test for "is image loaded"?


BenG - 4:28 pm on Jun 28, 2002 (gmt 0)


quickly tried this
function flip(name,src) {
if (navigator.appName == "Microsoft Internet Explorer") {
document.all.wait.style.visibility="visible";
}
else {
document.layers["wait"].visibility = "visible";
}
swapImage='images/clients/'+src
if (document.images){
document.images[name].src = swapImage;
// this onload event isn't working properly, triggers instantly....
waitFor(name)
//clearTimeout(imageTimeout);

}
}
function waitFor(img){
if(!img.complete){
imgWait=setTimeout('waitFor(img)', 250);
}
else{
showImage()
}
}
returned 'img' undefined....


Thread source:: http://www.webmasterworld.com/javascript/148.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com