enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

Adding targeted tooltip to image map area causes it to tie to image instead of area #121

Open yohanesyuen opened 9 years ago

yohanesyuen commented 9 years ago

Hi, I am currently trying to add a tooltip to an image map area. I have used it with some test elements with target option set to true successfully, however, when I try to use it with an area tag in an image map, the tooltip is tied to the edge of the image instead of the triggering area element. Use case is as follows

<img src="image.jpeg" usemap="#map1"/>
<map name="map1">
    <area id="area-1" shape="rect" coords="x1,y1,x2,y2">
</map>
<script>
   new Opentip("#area-1", HTML_data, {target:true});
</script>