Click to See Complete Forum and Search --> : Dynamic usemap tag.... help


redseven
03-11-2003, 05:49 PM
I'm trying to write some js that'll change the map an image uses on the fly. This is the stripped down version of my code:
--------------
<script language="javascript">
function change(choice)
{
window.document.menu.src = "images/" + choice + ".jpg";
window.document.menu.usemap = choice;
}
</script>

<map name="map1">
<area onMouseOver="change(map2)"> ----- </map>
<map name="map2"> ----- </map>
<img src="images/map1.jpg" ismap usemap="map1">
--------------


The image source changes fine, but the usemap never updates. I'm stuck with one map. Is it possible to change this dynamically.

Thanks!
Dan

redseven
03-12-2003, 12:45 PM
Thanks for the help, Dave. My coder is out of the office now, but I checked the code on the page and he did include image name, etc. It is still using the image map from the original image once another image is loaded, though. Is there any way around this that you know? Or perhaps a better way of doing this?

If you know of any sites that have a working menu set up to swap images on image map rollovers, I'd love to take a peek. Thanks again!

redseven