DOMPoint.z

DOMPoint 的 z 属性表示该点的深度坐标。 z 值为 0 表示屏幕平面,正值表示从屏幕前面向靠近用户的方向延伸,负值表示从屏幕后面向远离用户的方向延伸,除非改变了默认的轴方向。

语法

var zPos = DOMPoint.z;

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

规范

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

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
zChrome 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

相关链接

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