![]() | |
#1
| |||
| |||
|
#2
| |||||||||||
| |||||||||||
|
|
The following functions are working propery for IE, Ns 4.x and NS 6+ but the image I want to display disappears in IE. Why? |
|
function swapPic(layer,imgName,imgObj) { |
|
o = (n && layer?document.layers[layer].document.images[imgName]:document.images[imgName]); |
|
if(!o.hasswapped) o.src = eval(imgObj+".src"); |
|
} var oRef = null; var oRefImg = null; |
|
function keepPic(layer,imgName,imgObj) { if(oRef) { // swap image back oRef.src = oRefImg; } if (document.images) { |
|
o = (n && layer?document.layers[layer].document.images[imgName]:document.images[imgName]); |
|
if(o) { oRef = o oRefImg = o.src; o.src = eval(imgObj+".src"); |
|
o.hasswapped = true; } } } I use the following link to chose the image I want to display area shape="poly" alt="" coords="25,25,21,0,30,0" href="javascript:void(0)" title="" onMouseOver="swapPic('metera','diala','img1');" |
|
onClick="keepPic('metera','diala','img1');" |
|
div id="metera"><img src="images/pointer.aa.gif" alt="" name="diala" id="diala" width="50" height="50" border="0" usemap="#dialita"></div |
#3
| |||
| |||
|
|
Ken Tuck <webmaster (AT) eyecreate (DOT) net> writes: snip var oRefImg = null; This is later used as the src property of an image, so a better name would be "oRefSrc". |
|
area shape="poly" alt="" coords="25,25,21,0,30,0" href="javascript:void(0)" title="" onMouseOver="swapPic('metera','diala','img1');" onmouseover="swapPic('metera','diala',img1)" No need to send a string containing 'img1' as an argument, if you just use it to look up the value of the variable of that name. Just send the value directly. onClick="keepPic('metera','diala','img1');" onclick="keepPic('metera','diala',img1);" snip |
![]() |
| Thread Tools | |
| Display Modes | |
| |