Hi all,

I hope its not off-topic, it is after all to do with user friendliness.

I'm using some JavaScript to hide any images that have not loaded properly
or are missing. I don't like seeing the red crosses on a site, it looks
unprofessional.

http://www.sellmystuff.com.au/buystuff/generalstuff/parent-category.cfm?cate
goryIdentity=1

The problem is that on the MAC it removes all images like they have not
loaded properly. It only removes the ones within the HTML, not those placed
by CSS.

Following is the code used to check, obviously isLoadedImage always seems to
return false on the MAC for some reason. Would anyone know why?

function isLoadedImage( obj ) {
 if (!obj.complete) {
  return false;
 }
 if ( typeof obj.naturalWidth != "undefined" && obj.naturalWidth == 0 ) {
  return false;
 }

    return true;
}

function checkImage() {
 for ( var i = 0; i < document.images.length; i++ ) {
  if ( !isLoadedImage( document.images[ i ] ) ) {
   document.images[ i ].style.visibility = "hidden";
  }
 }
};
myWindow.doAddOnloadListener( checkImage );

Thanks in advance.

Kind regards, Taco Fleur


________________________________

clickfindT
www.clickfind.com.au the new Australian search engine for businesses,
products and services . 




*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to