onMouseOver for image maps

They have: 222 posts

Joined: Sep 1999

code:

<Map Name="Navigation Bar">
<Area Shape="Rect" Coords="10,20,74,33" HREf="Index.html" ALT="Main Page">
<Area Shape="Rect" Coords="10,51,93,65" HREF="Seniors.html" ALT="Senior Class">
<Area Shape="Rect" Coords="10,84,95,98" HREF="Juniors.html" ALT="Junior Class">
<Area Shape="Rect" Coords="10,117,78,145" HREF="IM.html" ALT="Instant Messaging">
<Area Shape="Rect" Coords="10,164,106,178" HREF="wwwboard\index.html" ALT="Message Board">
<Area Shape="Rect" Coords="10,196,80,210" HREF="WebDesign.html" ALT="Web Design">
<Area Shape="Rect" Coords="10,228,95,241" HREF="Programming.html" ALT="Programming">
<Area Shape="Rect" Coords="10,259,56,274" HREF="Photos.html" ALT="Photos">
<Area Shape="Rect" Coords="10,292,74,321" HREF="TechStaff.html" ALT="Technical Staff">
<Area Shape="Rect" Coords="10,340,61,353" HREF="Credits.html" ALT="Credits">
</Map>
[/code]

I thought I could put an onMouseOver, onMouseOut JavaScript function (I think function would be the correct term) after the ALT="whatever" (or anywhere else after the anchor), but it didn't work...So, does anyone know how to implement onMouseOvers (oh, for the statusbar btw) with an image map?

Thanks,
ian

------------------
 http://members.antionline.com/cst/ 

They have: 5,633 posts

Joined: Jan 1970

You could always call your JavaScript function from the HREF="" part.

<Area Shape="Rect" Coords="10,20,74,33" HREF="javascript:displayInfo('MESSAGE')" ALT="Main Page">

Heres the function to use to display text into the status bar.

function displayInfo(value) {
window.status = value;
}

------------------
http://go.to/hass

They have: 222 posts

Joined: Sep 1999

But then it wouldn't be a link anymore...

------------------
Ian
http://members.antionline.com/cst/

They have: 5,633 posts

Joined: Jan 1970

Add the following in each area tag:

onMouseover="window.status='Text to go in Status Bar'; return true" onMouseout="window.status=''; return true"

This will put the text in the status bar when you move the cursor over that part of the image, and remove the text when you move the cursor off the image.

Using this code in the area tag only works with Netscape, but you can use it in a regular <a> link tag.

For more onMouseover tutorials check out:
http://www.pageresource.com/jscript/jmouse.htm

They have: 222 posts

Joined: Sep 1999

Thanks, that worked in NS... But does anyone know how to use the onMouseOver statusbar script on image maps for IE?

------------------
Ian
http://members.antionline.com/cst/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.