Click to See Complete Forum and Search --> : Image Map JavaScript rollovers


Ascendancy
01-04-2007, 08:02 PM
I have an Image Map set up so that the image is my banner, and it has different sections for home, contact, whatever it may be. I already set up the different rectangle shapes, and the links works fine and everything. What I tried to do is name the image itself "banner", then I did a mouseover effect on the rectangle shape, but nothing happened. Here is the code:

<img src="images/banner.jpg" usemap="#banner" border="0" name="banner">
<map name="banner">
<area shape="rect" coords="310,22,363,37" href="news.html"

onmouseover="docmuent.banner.src='images/bannerHome.jpg'">

I have an external .js file to pre-load the images.

gil davis
01-05-2007, 05:52 AM
The <map> doesn't have a src. Name the <img> and it ought to work.

Ascendancy
01-05-2007, 02:44 PM
What's the code for that?

gil davis
01-05-2007, 07:17 PM
Let me start over. I didn't notice the first time that your image already had a name.
<img src="images/banner.jpg" usemap="#banner" border="0" name="banner">
<map name="banner">
<area shape="rect" coords="310,22,363,37" href="news.html" onmouseover="docmuent.banner.src='images/bannerHome.jpg'">Maybe it is just a typo. Did you mean "document"?
If that doesn't fix it, you might change the name from "banner" to something else to eliminate confusion. Actually, your "document" has (at least) two things with the name "banner". You might find that the image is accessible usingdocument.images["banner"].srcordocument.banner[1].srcEither one should resolve the abiguity.

Ascendancy
01-06-2007, 07:05 PM
Thank you so much! It was the type-o "docmuent", you were right on that one. Big help, thanks again!