DocumentOrShadowRoot.elementsFromPoint()

这篇翻译不完整。请帮忙从英语翻译这篇文章

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

elementsFromPoint()DocumentOrShadowRoot 下的一个函数,该函数返还在特定坐标点下的HTML元素数组。

语法

var elements = document.elementsFromPoint(x, y);

参数

x
坐标点的水平坐标值
y
坐标点的垂向坐标值

返回值

一个包含 element 对象的数组.

其他说明

Specification Status Comment
Shadow DOM
elementsFromPoint()
Obsolete Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
elementsFromPoint
Experimental
Chrome Full support 53
Notes
Full support 53
Notes
Notes Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
Edge Full support YesFirefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53
Notes
Full support 53
Notes
Notes Before WebView 66, this method returned null when the element was a child of a host node. See issue 759947.
Chrome Android Full support 53
Notes
Full support 53
Notes
Notes Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
Edge Mobile Full support YesFirefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0

Legend

Full support  
Full support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

文档标签和贡献者

此页面的贡献者: fscholz, mdnwebdocs-bot, 1Cr18Ni9
最后编辑者: fscholz,