We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

GlobalEventHandlers.onpointerdown

这篇翻译不完整。请帮忙从英语翻译这篇文章

 pointerdown 事件的 全局事件处理程序 

语法

var downHandler = targetElement.onpointerdown;

返回值

downHandler
pointerdown 事件触发对象的事件处理程序.

示例

当前示例展示两种方式使用 onpointerdown 去设置元素的pointerdown事件处理程序.

<html>
<script>
function downHandler(ev) {
 // Process the pointerdown event
}
function init() {
 var el=document.getElementById("target1");
 el.onpointerdown = downHandler;
}
</script>
<body onload="init();">
<div id="target1"> Touch me ... </div>
<div id="target2" onpointerdown="downHandler(event)"> Touch me ... </div>
</body>
</html>

规范

Specification Status Comment
Pointer Events – Level 2
onpointerdown
Working Draft Non-stable version
Pointer Events
onpointerdown
Recommendation Initial definition

浏览器支持

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 55.0 (Yes) (Yes) 10 42 未实现
Feature Android Android Webview Edge Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support 未实现 55.0 (Yes) 未实现 未实现 10 42 未实现 55.0

 

参阅

文档标签和贡献者

此页面的贡献者: leonkwok1992
最后编辑者: leonkwok1992,