代码之家  ›  专栏  ›  技术社区  ›  Barrie Reader

从点(x,y)获取元素-什么?

  •  4
  • Barrie Reader  · 技术社区  · 15 年前

    我有 一定地

    我的代码:

    $(document).click(function (e) {
      var getPoint = document.getElementFromPoint(e.pageX,e.pageY);
      alert(getPoint);
    });
    

    错误

    document.getElementFromPoint is not a function
    
    2 回复  |  直到 12 年前
        1
  •  8
  •   tautologe    15 年前

    在Firefox中,这个函数被称为document.elementFromPoint()

    https://developer.mozilla.org/En/DOM:document.elementFromPoint

        2
  •  2
  •   Siva Gopal    15 年前

    我已经将方法从:getElementFromPoint更改为:elementFromPoint,并且在IE8&最新的firefox中运行良好。