.click on an image map

.click on an image map

Hi Guys,

complete newbie here, so be nice!

I have the following code that I want to fire as the result of somebody clicking an area on an image map:

  1. $('#Process').click(function () {
  2.             //do stuff
  3.             }

and the image map is:

  1. <div id="Banner" >
  2.   <div style="text-align:center; width:842px; margin-left:auto; margin-right:auto;">
  3. <img id="ImageMap" src="divimage.jpg" usemap="#ImageMap" border="0" width="842" height="226" alt="" />
  4. <map id="_ImageMap" name="ImageMap">
  5. <area shape="rect" coords="810,80,837,112" a href="#"/>
  6. <area shape="rect" coords="323,170,518,207" a href="#" onclick="LPM_CLICK('http://www.google.com');"/>
  7. <area shape="rect" coords="323,170,518,207" a href="#" onclick="LPM_CLICK('http://www.facebook.com');"/>
  8. </map></div>
  9. </div>
if I wanted to run my function from the click area in line 5 above, what do I need to do? does it simply need a name/id of 'Process'? or in my function do I need to change the name to area.nameOfClickElement?


Any help is much appreciated.

Thanks,
Wozza