Here is my script:
<script>
var homeOff = new Image();
var homeOn = new Image();
homeOff.src = "images/menu_homeOff.gif";
homeOn.src = "images/menu_homeOn.gif";
function roll1(){document.images[0].src="images/menu_homeOn.gif"}
function roll2(){document.images[0].src="images/menu_homeOff.gif"}
</script>
and here is where the function is called:
<a href="home.htm" onMouseOver="roll1()" onMouseOut="roll2()"><img src="images/menu_homeOff.gif" border=0></a>
The problem is, if I place an image above the rollover image (above), and type it like this:
<img src="images/header.gif"><br>
<a href="home.htm" onMouseOver="roll1()" onMouseOut="roll2()"><img src="images/menu_homeOff.gif" border=0></a>
If I mouse over the menu_homeOff.gif image, the header.gif image changes. When I delete the header image, menu_homeOff.gif changes to menu_homeOn.gif when I mouse over it, like it's supposed to.
What can I do to fix this? Thanks.
<script>
var homeOff = new Image();
var homeOn = new Image();
homeOff.src = "images/menu_homeOff.gif";
homeOn.src = "images/menu_homeOn.gif";
function roll1(){document.images[0].src="images/menu_homeOn.gif"}
function roll2(){document.images[0].src="images/menu_homeOff.gif"}
</script>
and here is where the function is called:
<a href="home.htm" onMouseOver="roll1()" onMouseOut="roll2()"><img src="images/menu_homeOff.gif" border=0></a>
The problem is, if I place an image above the rollover image (above), and type it like this:
<img src="images/header.gif"><br>
<a href="home.htm" onMouseOver="roll1()" onMouseOut="roll2()"><img src="images/menu_homeOff.gif" border=0></a>
If I mouse over the menu_homeOff.gif image, the header.gif image changes. When I delete the header image, menu_homeOff.gif changes to menu_homeOn.gif when I mouse over it, like it's supposed to.
What can I do to fix this? Thanks.