window属性:ontouchmove

2018-05-31 11:57 更新

ontouchmove属性

touchmove事件的全局事件处理程序。

注意:这个属性已经不被正式标准化。它在Touch Events – Level 2 Editor's Draft规范中指定,不在Touch Events Recommendation中。这个属性没有被广泛实现。

ontouchmove属性语法

var moveHandler = someElement.ontouchmove;

返回值

moveHandler
someElement元素的touchmove事件处理程序。

ontouchmove属性示例

此示例显示了使用ontouchmove设置元素的touchmove事件处理程序的两种方法。

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

规范

规范状态注释
Touch Events – Level 2
Editor's Draft
非稳定版本
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号