--- title: GlobalEventHandlers.ontouchmove slug: conflicting/Web/API/GlobalEventHandlers/ontouchmove translation_of: Web/API/GlobalEventHandlers/ontouchmove translation_of_original: Web/API/GlobalEventHandlers/GlobalEventHanders.ontouchmove original_slug: Web/API/GlobalEventHandlers/GlobalEventHanders.ontouchmove ---
A {{domxref("GlobalEventHandlers","global event handler")}} for the {{event("touchmove")}} event.
注意:这个属性还没有正式的标准。它在 {{SpecName('Touch Events 2')}} {{Spec2('Touch Events 2')}} 说明书里被规定且不在 {{SpecName('Touch Events')}} {{Spec2('Touch Events')}}中。这个属性没有被广泛应用。
var moveHandler = someElement.ontouchmove;
moveHandler
someElement
.This example shows two ways to use ontouchmove to set an element's touchmove event handler.
<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>
Specification | Status | Comment |
---|---|---|
{{SpecName('Touch Events 2','#widl-GlobalEventHandlers-ontouchmove')}} | {{Spec2('Touch Events 2')}} | Non-stable version. |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support |
Feature | Android | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|
Basic support |