I made an image into a map with images-map.com

I made some clickable areas, but i cant figure out how to make a function when i click on one of the areas. When I click on the images it will direct me to a website.

<img id="Image-Maps-Com-image-maps-2014-02-12-182158" src=images/map2.png border="0" width="491" height="360" usemap="#image-maps-2014-02-12-182158" alt="" />

<map name="image-maps-2014-02-12-182158" id="ImageMapsCom-image-maps-2014-02-12-182158">

<area shape="rect" coords="489,358,491,360" alt="Image Map" title="Image Map" href="http://www.image-maps.com/index.php?aff=mapped_users_0" />

<area id="cen" shape="poly" coords="242,117,227,117,212,143,232,175,244,173,252,169,264,166,272,161,278,155" alt="Centrum" title="Centrum" target="_self" href="http://www.image-maps.com/"     />
</map>

I want to make a function that loads an ID of a highchart that I made when I click on that part of the image.

I tried to replace the href="http://www.image-maps.com/" with an id but it doesnt work

有帮助吗?

解决方案

Do you mean JavaScript function? If yes, use JavaScript Framework, for example jQuery. If you use jQuery, here is simple event that will be bind to any img HTML tag.

$("img").click(function(){
alert("The image clicked");
}};
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top