此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
Document:exitPointerLock() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Document 接口的 exitPointerLock() 方法异步释放先前通过 Element.requestPointerLock 请求的指针锁定。
备注:在文档上调用 exitPointerLock() 方法,在元素上调用 requestPointerLock() 方法。
要跟踪请求的成功或失败,需要监听 pointerlockchange 事件和 pointerlockerror 事件。
语法
js
exitPointerLock()
参数
无。
返回值
无(undefined)。
规范
| Specification |
|---|
| Pointer Lock 2.0> # dom-document-exitpointerlock> |
浏览器兼容性
Enable JavaScript to view this browser compatibility table.