以前用到是别人做好的,最近再次用到果然还是不会,本想借助网络,但网上大忽悠太多了,疲于分辨。翻箱倒柜找到过去的例子,看了一下,原来挺简单的。
首先在你的图片测好热区的左上点和右下点的坐标,本人用的是qq的截图功能,例如:左上:303,591 右下:385,612,然后我们就可以将下面的源码加入到源文件的适当位置
<img src="image.jpg" alt="" usemap="#map" ismap="ismap" style="border:none;" />
<map id="map" name="map">
<area shape="rect" coords="303,591,385,612" style="cursor:hand;" href="http://192.168.53.155" alt="提示" target="_blank" />
</map>
圆形的话,先找圆心:300,300,然后加半径
<img src="image.jpg" alt="" usemap="#map" ismap="ismap" style="border:none;" />
<map id="map" name="map">
<area shape="circle" coords="300,300,50" style="cursor:hand;" href="http://192.168.53.200" alt="haha" target="_blank" />
</map>
<area shape="default" coords="200,200,500,500" style="cursor:hand;" href="" alt="" target="_blank" />
shape为default时,如果两个数值,则是从原点到该点的矩形区域;三个则是圆形;四个则与rect效果一样。
shape如果为poly时,则是多边形。
这样就OK了...