DOMPoint.x

DOMPoint 的 x 属性表示该点的水平坐标。 通常, x 的正值表示右边,负值表示左边,除非改变了默认的轴方向。

语法

var xPos = DOMPoint.x;

双精度浮点值,表示该点的 x 坐标值。这个值的类型并没有严格限制,意味着它可以是 NaN±Infinity

规范

Specification Status Comment
Geometry Interfaces Module Level 1
x
Candidate Recommendation Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
xChrome Full support 61Edge Full support 79Firefox Full support 31IE No support NoOpera Full support 48Safari Full support 10.1WebView Android Full support 61Chrome Android Full support 61Firefox Android Full support 31Opera Android Full support 45Safari iOS Full support 10.3Samsung Internet Android Full support 8.0

Legend

Full support  
Full support
No support  
No support

相关链接

  • 其他坐标属性:yz,透视值 w.