【问题标题】:Position a div dynamically based off the position of an area shape in image根据图像中区域形状的位置动态定位 div
【发布时间】:2013-07-10 22:04:58
【问题描述】:

如果我的区域形状在这个 id 下看起来像这样,那么在 jquery 中解决这个问题的最佳方法是什么。

 <area id="five" shape="rect" coords="610,22,653,62" href="#" />

【问题讨论】:

    标签: jquery imagemap


    【解决方案1】:

    我认为区域形状并不重要。你也许可以这样做:

    var $areaShape = $("#five"), $div = $("<div>Cool Stuff bro.</div>");
    $div.css({
      position : "absolute",
      top : $areaShape.offset().top,
      left : $areaShape.offset().left
    });
    $("body").append($div);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-20
      • 1970-01-01
      • 2013-11-30
      • 1970-01-01
      • 2011-10-14
      • 2017-04-21
      • 1970-01-01
      相关资源
      最近更新 更多