janetb
09-30-2004, 05:39 PM
Thought I understood, but head is sore from banging on the desk. Want to do two image swaps in two different areas. Top is large state image with image map hrefs which completely swaps out as m. Underneath is list of cities with a 'blank' image (arr) - also href. When the mouse is over the city name, I want the 'blank' image to switch to arrow and the large state map to switch highlighting county. I've got top part to work from both href references (county or m), but not the flashing arrow (arr). Tried it without all of the arr array - didn't seem needed, but didn't work. I have used them separately and it worked, but I'm stumped. Any Help? Here it is:
<header>
function swapover(n) // swaps the images on each mouseover
{
document.images['m'].src = eval("m" + n + ".src");
document.images['arr'+n ].src= eval("arr1.src");
}
function swapout(n) // swaps the images back on each mouseout
{
document.images['m'].src = eval("m0.src");
document.images['arr'+n ].src = eval("arr0.src");
}
// --></script>
</head>
<body topmargin="5" leftmargin="5"><center>
<script language="Javascript">
<!--
if (document.images)
{
arr0 = new Image(9,9);
arr0 = "images/pixel2.gif";
arr1 = new Image(9,9);
arr1 = "images/arrow13t.gif";
arr2 = new Image(9,9);
arr2 = "images/arrow13t.gif";
etc...
m0 = new Image(475,288);
m0.src = "images/m0.gif";
m1 = new Image(475,288);
m1.src = "images/m1.gif";
m2 = new Image(475,288);
m2.src = "images/m2.gif";
m4 = new Image(475,288);
m4.src = "images/m4.gif";
m5 = new Image(475,288);
m5.src = "images/m5.gif";
m7 = new Image(475,288);
etc....}
// --></script>
<img border="0" src="images/m0.gif" name="m" usemap="#FPMap0" width="475" height="288">
<map name="FPMap0">
<area onmouseover="swapover(2)" onmouseout="swapout(2)" href="http://www.something.org/" shape="polygon" coords="260, 111, 344, 81, 372, 151, 284, 167">
<area onmouseover="swapover(9)" onmouseout="swapout(9)" href="http://www.something.org/" shape="polygon" coords="21, 213, 20, 265, 78, 263, 99, 226, 120, 223, 125, 207, 76, 213, 63, 198">
<area onmouseover="swapover(5)" onmouseout="swapout(5)" href="http://www.something.org/" shape="polygon" coords="244, 85, 284, 166, 254, 192, 211, 148, 191, 107">etc....map>
<a onmouseover='swapover(1)' onmouseout='swapout(1)' class='home3' href='http://www.something.org'>
<img src='../images/pixel2.gif' border='0' width='9' height='9' name='arr1'>Some city one</a><br>
<a onmouseover='swapover(15)' onmouseout='swapout(15)' class='home3' href='http://www.something.org'>
<img src='../images/pixel2.gif' border='0' width='9' height='9' name='arr15'>Some city two</a><br>
etc.
<header>
function swapover(n) // swaps the images on each mouseover
{
document.images['m'].src = eval("m" + n + ".src");
document.images['arr'+n ].src= eval("arr1.src");
}
function swapout(n) // swaps the images back on each mouseout
{
document.images['m'].src = eval("m0.src");
document.images['arr'+n ].src = eval("arr0.src");
}
// --></script>
</head>
<body topmargin="5" leftmargin="5"><center>
<script language="Javascript">
<!--
if (document.images)
{
arr0 = new Image(9,9);
arr0 = "images/pixel2.gif";
arr1 = new Image(9,9);
arr1 = "images/arrow13t.gif";
arr2 = new Image(9,9);
arr2 = "images/arrow13t.gif";
etc...
m0 = new Image(475,288);
m0.src = "images/m0.gif";
m1 = new Image(475,288);
m1.src = "images/m1.gif";
m2 = new Image(475,288);
m2.src = "images/m2.gif";
m4 = new Image(475,288);
m4.src = "images/m4.gif";
m5 = new Image(475,288);
m5.src = "images/m5.gif";
m7 = new Image(475,288);
etc....}
// --></script>
<img border="0" src="images/m0.gif" name="m" usemap="#FPMap0" width="475" height="288">
<map name="FPMap0">
<area onmouseover="swapover(2)" onmouseout="swapout(2)" href="http://www.something.org/" shape="polygon" coords="260, 111, 344, 81, 372, 151, 284, 167">
<area onmouseover="swapover(9)" onmouseout="swapout(9)" href="http://www.something.org/" shape="polygon" coords="21, 213, 20, 265, 78, 263, 99, 226, 120, 223, 125, 207, 76, 213, 63, 198">
<area onmouseover="swapover(5)" onmouseout="swapout(5)" href="http://www.something.org/" shape="polygon" coords="244, 85, 284, 166, 254, 192, 211, 148, 191, 107">etc....map>
<a onmouseover='swapover(1)' onmouseout='swapout(1)' class='home3' href='http://www.something.org'>
<img src='../images/pixel2.gif' border='0' width='9' height='9' name='arr1'>Some city one</a><br>
<a onmouseover='swapover(15)' onmouseout='swapout(15)' class='home3' href='http://www.something.org'>
<img src='../images/pixel2.gif' border='0' width='9' height='9' name='arr15'>Some city two</a><br>
etc.