diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/element/requestpointerlock | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/element/requestpointerlock')
-rw-r--r-- | files/zh-cn/web/api/element/requestpointerlock/index.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/element/requestpointerlock/index.html b/files/zh-cn/web/api/element/requestpointerlock/index.html new file mode 100644 index 0000000000..c5b6c49d75 --- /dev/null +++ b/files/zh-cn/web/api/element/requestpointerlock/index.html @@ -0,0 +1,48 @@ +--- +title: Element.requestPointerLock() +slug: Web/API/Element/requestPointerLock +translation_of: Web/API/Element/requestPointerLock +--- +<div>{{ APIRef("DOM") }}{{ seeCompatTable }}</div> + +<p><strong><code>Element.requestPointerLock()</code></strong> 方法允许您异步地请求将鼠标指针锁定在指定元素上。</p> + +<p>若想追踪请求成功还是失败,则需要在 {{domxref("Document")}} 级别监听 {{event("pointerlockchange")}} 和 {{event("pointerlockerror")}} 事件。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox notranslate"><em>instanceOfElement</em>.requestPointerLock(); +</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">备注</th> + </tr> + <tr> + <td>{{SpecName('Pointer Lock','#dom-element-requestpointerlock','requestPointerLock()')}}</td> + <td>{{Spec2('Pointer Lock')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<div> + + +<p>{{Compat("api.Element.requestPointerLock")}}</p> +</div> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{ domxref("Document.pointerLockElement") }}</li> + <li>{{ domxref("Document.exitPointerLock()") }}</li> + <li><a href="/Web/API/Pointer_Lock_API">Pointer Lock</a></li> +</ul> |