javascript thread: rollovers not working in netscape, but working in ie, why?
Message #1 by soni29@h... on Sat, 27 Oct 2001 16:38:11
|
|
hi,
i made a site which contained rollover images, it works fine in ie but not
in netscape. in netscape the images show but the rollover effect is not
working. any ideas? the code is below, thanks:
<HTML>
<HEAD>
<script language = "JavaScript">
<!-- ignore if JavaScript not supported
var home = new Array();
var myArray = new Array();
myArray[0] = new Array(); // to hold home images
myArray[1] = new Array(); // to hold strength images
myArray[2] = new Array(); // to hold weakness images
myArray[3] = new Array(); // to hold recommended changes images
myArray[4] = new Array(); // to hold techniques used images
myArray[5] = new Array(); // to hold the ie vs. netscape images
myArray[0][0] = "homea.gif";
myArray[0][1] = "homeb.gif";
myArray[0][2] = "homec.gif";
myArray[1][0] = "strengtha.gif";
myArray[1][1] = "strengthb.gif";
myArray[1][2] = "strengthc.gif";
myArray[2][0] = "weaknessa.gif";
myArray[2][1] = "weaknessb.gif";
myArray[2][2] = "weaknessc.gif";
myArray[3][0] = "changesa.gif";
myArray[3][1] = "changesb.gif";
myArray[3][2] = "changesc.gif";
myArray[4][0] = "techa.gif";
myArray[4][1] = "techb.gif";
myArray[4][2] = "techc.gif";
myArray[5][0] = "ievsna.gif";
myArray[5][1] = "ievsnb.gif";
myArray[5][2] = "ievsnc.gif";
function swap(x,y) {
document.images[x].src = myArray[x][y];
return false;
}
-->
</script>
</HEAD>
<BODY bgColor = "7dc5f5">
<br>
<a href = "frame-body-main.htm" target = "main">
<img border = "0" src = "homea.gif" alt = "Back Home" onmouseover
= "return swap(0,1)"
onmouseout = "return swap(0,0)" onmousedown = "return swap(0,2)" onmouseup
= "return swap(0,1)">
<a/>
<br>
<a href = "frame-body-strength.htm" target = "main">
<img border = "0" src = "strengtha.gif" alt = "Strengths" onmouseover
= "return swap(1,1)"
onmouseout = "return swap(1,0)" onmousedown = "return swap(1,2)" onmouseup
= "return swap(1,1)">
</a>
<br>
<a href = "frame-body-weakness.htm" target = "main">
<img border = "0" src = "weaknessa.gif" alt = "Weaknesses" onmouseover
= "return swap(2,1)"
onmouseout = "return swap(2,0)" onmousedown = "return swap(2,2)" onmouseup
= "return swap(2,1)">
</a>
<br>
<a href = "frame-body-changes.htm" target = "main">
<img border = "0" src = "changesa.gif" alt = "Recommended Changes"
onmouseover = "return swap(3,1)"
onmouseout = "return swap(3,0)" onmousedown = "return swap(3,2)" onmouseup
= "return swap(3,1)">
</a>
<br>
<a href = "frame-body-techused.htm" target = "main">
<img border = "0" src = "techa.gif" alt = "Techniques Used" onmouseover
= "return swap(4,1)"
onmouseout = "return swap(4,0)" onmousedown = "return swap(4,2)" onmouseup
= "return swap(4,1)">
</a>
<br>
<a href = "frame-body-ievsnet.htm" target = "main">
<img border = "0" src = "ievsna.gif" alt = "Internet Explorer Vs.
Netscape" onmouseover = "return swap(5,1)"
onmouseout = "return swap(5,0)" onmousedown = "return swap(5,2)" onmouseup
= "return swap(5,1)">
</a>
</BODY>
</HTML>
|