What am I doing wrong here?
I'm trying to make a simple rollover that changes image from black/white to color. The images are displayed in b/w and all end in "_bw.jpg" and on mouseOver I want to change to color - thoses images all end in "_cr.jpg"
My javascript is:
the html side looks like this for an image:
The first alert, which I commented out, works fine. The second, which I would have expected to be identical, never shows up, which means its null
and the images never change.
Any clue as to how lame I am?
Thanks,
Marty
I'm trying to make a simple rollover that changes image from black/white to color. The images are displayed in b/w and all end in "_bw.jpg" and on mouseOver I want to change to color - thoses images all end in "_cr.jpg"
My javascript is:
Code:
function mouseOver(imgName) { //alert(imgName + "_cr.jpg"); document.imgName.src = imgName + "_cr.jpg"; alert(document.imgName.src); } function mouseOut(imgName) { //alert(imgName + "_bw.jpg"); document.imgName.src = imgName + "_bw.jpg"; alert(document.imgName.src); }
Code:
<div align="center"><a href="Breakfast Menu.html"><img src="bfast_bw.jpg" name="bfast" width="399" height="600" alt="Breakfast" onmouseOver="mouseOver('bfast')" onmouseOut="mouseOut('bfast')" /></a>
and the images never change.
Any clue as to how lame I am?
Thanks,
Marty
Comment