wynton_ca
06-03-2003, 04:08 PM
Hey all, I was wondering if you might be able to help me with this one. This code works fine with IE on PC. However In Netscape 6x and on the mac (both browsers) the image does not change one bit. Ive put this together for an onclick event so that when the image is clicked, it will swap with another, and vice versa.
function chng(c_img, img1, img2) {
if (document[c_img].src.indexOf(img1)!= -1) document[c_img].src = img2;
else document[c_img].src = img1;
}
<a href="#" onclick="chng('show','firstimagepath.gif','secondimagepath.gif');"><img src="firstimage.gif" width="113" height="27" alt="Show Details" border="0" name="show"></a>
function chng(c_img, img1, img2) {
if (document[c_img].src.indexOf(img1)!= -1) document[c_img].src = img2;
else document[c_img].src = img1;
}
<a href="#" onclick="chng('show','firstimagepath.gif','secondimagepath.gif');"><img src="firstimage.gif" width="113" height="27" alt="Show Details" border="0" name="show"></a>