参考http://www.jonllen.com/jonllen/js/77.aspx

http://blog.csdn.net/bestchen_1/archive/2009/07/31/4396749.aspx

最好的:http://hi.baidu.com/qdh126/blog/item/e5efb2ce86870e0592457ef0.html

其实最重要的是获取img的坐标,再通过area内热点的定位就可以了

    function getAbsPoint(e)  //e为元素对象,获得此元素的左上角坐标 (x,y)和宽、高
    {
        var x = e.offsetLeft, y = e.offsetTop, h = e.clientHeight, w = e.clientWidth;
        while (e = e.offsetParent) {
            x += e.offsetLeft;
            y += e.offsetTop;           
        }
        var ePoint = { "l": x, "t": y, "h": h, "w": w };
        return ePoint;
    } 

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-05-29
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案