Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MouseOver (2 Events)

Status
Not open for further replies.

Soti

Programmer
Jul 9, 2001
34
US
I can't seem to get the second image to change with the rollover, any assistance would be appreciated:
if (document.images) {
image1on = new Image();
image1on.src = "sofa/so-belmondo-rollover-opt.jpg";

image2on = new Image();
image2on.src = "sofa/so-allen-rollover-opt.jpg";

image3on = new Image();
image3on.src = "sofa/so-bissett-rollover-opt.jpg";

image1off = new Image();
image1off.src = "sofa/sobelmondo1.jpg";

image2off = new Image();
image2off.src = "sofa/soallen1.jpg";

image3off = new Image();
image3off.src = "sofa/sobissett1.jpg";
otherImageDefault = new Image();

otherImageDefault.src = "sofa/Red-block-sofa.jpg";

otherImage1 = new Image();
otherImage1.src = "sofa/Red-block-Belmondo.gif";

otherImage2 = new Image();
otherImage2.src = "sofa/Red-block-Allen.gif";

otherImage3 = new Image();
otherImage3.src = "sofa/Red-block-Bisset.gif";

}

function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments].src = eval(changeImages.arguments[i+1] + &quot;.src&quot;);
}
}
}

<td valign=&quot;top&quot; rowspan=&quot;2&quot;><img name=&quot;otherImageDefault&quot; src=&quot;sofa/Red-block-sofa.jpg&quot; border=0></td><td valign=&quot;top&quot;><img src=&quot;Generic_Images/Greenblock1.jpg&quot; border=&quot;0&quot;></td><td valign=&quot;top&quot;><a href=&quot;belmondo.shtml&quot; onMouseOver=&quot;changeImages('image1', 'image1on', 'otherImage', 'otherImage1')&quot; onMouseOut=&quot;changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault')&quot;><img name=&quot;image1&quot; src=&quot;sofa/sobelmondo1.jpg&quot; alt=&quot;&quot; width=91 height=41 border=0></a></td>
<td valign=&quot;top&quot;><a href=&quot;allen.shtml&quot; onMouseOver=&quot;changeImages('image2', 'image2on', 'otherImage', 'otherImage2')&quot; onMouseOut=&quot;changeImages('image2', 'image2off', 'otherImage', 'otherImageDefault')&quot;><img name=&quot;image2&quot; src=&quot;sofa/soallen1.jpg&quot; alt=&quot;&quot; width=91 height=41 border=0></a></td><td valign=&quot;top&quot;><a href=&quot;bissett.shtml&quot; onMouseOver=&quot;changeImages('image3', 'image3on', 'otherImage', 'otherImage3')&quot; onMouseOut=&quot;changeImages('image3', 'image3off', 'otherImage', 'otherImageDefault')&quot;><img name=&quot;image3&quot; src=&quot;sofa/sobissett1.jpg&quot; alt=&quot;&quot; width=91 height=41 border=0></a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top