codecamp

window属性:ontouchmove

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
非稳定版本
window属性:ontouchcancel
window属性:ontouchstart
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定