此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

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 事件。