View Full Version : Using Image Maps

03-14-2005, 10:30 PM
I have created image maps from a .gif and I am trying to get a menu to popup when I go over these hotspots so I can give another list of options to the user. I have looked for other websites that use the same idea and found them, but I think most of their javaScript code is hidden.

My questions are:
1. Is javaScript good to use for this purpose?
2. How do I get the menu to be visible or for that fact how do I create that menu?

Here's what the map code looks like:
<map name="something" id="someID">
<area shape="rect" coords="23,32,2,23" href='#'>

I am hoping to popup this menu when the mousebutton is pressed so it wouldn't be annoying. So I'm thinking like a onmouseDown event.

If anyone can help. Thanks!

03-15-2005, 01:11 PM
Did I not word the questions right?

03-15-2005, 01:20 PM
My suggestion would be to first make the menu inside a div, so that it looks OK.
After that, add a simple "display: none;" in your CSS to hide the menu.

Then, using the javascript onclick event handler, you can show the menu like this:

<imagemapwhatever onclick="this.style.display='block';">

Where the imagemapwhatever is your normal imagemap code.