elementFromPoint 获得鼠标所在位置处的对象

来源:互联网 发布:tensorflow 朴素贝叶斯 编辑:程序博客网 时间:2024/05/16 05:07
elementFromPoint 获得鼠标所在位置处的对象   
语法:
oElement = document . elementFromPoint ( iX , iY )
参数:
iX : 必选项。整数(Integer)。单位:象素(Pixel)。定位横坐标偏移量。 iY : 必选项。整数(Integer)。单位:象素(Pixel)。定位纵坐标偏移量。
返回值:
oElement : 对象(Element)。返回获取的对象的引用。
说明:
根据横纵坐标值 iX iY 获取对象 oElement oElement 必须支持和响应鼠标事件。
提供的坐标是客户区坐标。客户区的左上角为 (0,0)。
当将此方法用于 Structured Graphics Sprite 对象时,必须设置 MouseEventsEnabled 属性值为 1 。
示例代码:




  • 列表项目1
  • 列表项目2
  • 列表项目3
  • 列表项目4


请将鼠标移动到项目列表上。

请参见:DOM的属性 | DOM的方法

原创粉丝点击