GlobalEventHandlers.onpointerout
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2020.
一个global event handler
用于处理 pointerout
事件。
语法
在类似 addEventListener()
这样的方法中使用事件名称,或设置事件处理器属性。
js
addEventListener("pointerout", (event) => {});
onpointerout = (event) => {};
返回值
outHandler
-
元素
targetElement
的指针输出事件处理程序。
示例
这个例子展示了两种方式来使用 onpointerout 设置元素的 pointerout 事件处理程序。
js
<html>
<script>
function outHandler(ev) {
// Process the pointerout event
}
function init() {
var el=document.getElementById("target1");
el.onpointerout = outHandler;
}
</script>
<body onload="init();">
<div id="target1"> Touch me ... </div>
<div id="target2" onpointerout="outHandler(event)"> Touch me ... </div>
</body>
</html>
规范
Specification |
---|
Pointer Events # the-pointerout-event |
Pointer Events # dom-globaleventhandlers-onpointerout |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
pointerout event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Requires a vendor prefix or different name for use.
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.