Display alternate image onmouseover
Posted: Fri Mar 21, 2014 10:45 am
I am using this code to display and image onmouseover.
1. this works when the image is found.
2. If the image is not found I am trying to display the imagenotfound.jpg, but all that is displayed is the broken image icon
3. If the image is not found and they was a previous image displayed, the previous image remains
4. There are multiple sub-directories in the media.topnotchinc.com path and I have not been able to determine if it is possible to search the entire folder, including sub-directories, for an available image.
any help would be appreciated.
Code: Select all
var itemImage = new Image();
removeElement(elemObj)
itemImage.src = "http://media.topnotchinc.com/SR/240X240/" + get("D_2_4") + ".jpg" ;
itemImage.onerror = function (){
itemImage.src = "http://media.topnotchinc.com/imagenotfound.jpg";
};
var elemObj = newElement(3, 85, "img", itemImage);
2. If the image is not found I am trying to display the imagenotfound.jpg, but all that is displayed is the broken image icon
3. If the image is not found and they was a previous image displayed, the previous image remains
4. There are multiple sub-directories in the media.topnotchinc.com path and I have not been able to determine if it is possible to search the entire folder, including sub-directories, for an available image.
any help would be appreciated.