From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../globaleventhandlers/ontouchcancel/index.html | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 files/zh-cn/web/api/globaleventhandlers/ontouchcancel/index.html (limited to 'files/zh-cn/web/api/globaleventhandlers/ontouchcancel') diff --git a/files/zh-cn/web/api/globaleventhandlers/ontouchcancel/index.html b/files/zh-cn/web/api/globaleventhandlers/ontouchcancel/index.html new file mode 100644 index 0000000000..faba488dc4 --- /dev/null +++ b/files/zh-cn/web/api/globaleventhandlers/ontouchcancel/index.html @@ -0,0 +1,126 @@ +--- +title: GlobalEventHandlers.ontouchcancel +slug: Web/API/GlobalEventHandlers/ontouchcancel +translation_of: Web/API/GlobalEventHandlers/ontouchcancel +--- +
{{ApiRef("HTML DOM")}}
+ +

A {{domxref("GlobalEventHandlers","global event handler")}} for the {{event("touchcancel")}} event.

+ +

{{SeeCompatTable}}

+ +
+

Note: 这个属性没有被正式标准化。它在 {{SpecName('Touch Events 2')}} 被指定,{{Spec2('Touch Events 2')}} 规范 并且没有在 {{SpecName('Touch Events')}} {{Spec2('Touch Events')}}。此属性没有被广泛实现。

+
+ +

语法

+ +
var cancelHandler = someElement.ontouchcancel;
+
+ +

返回值

+ +
+
cancelHandler
+
元素someElement上的touchcancel事件句柄。
+
+ +

例子

+ +

这个例子展示了两种方法在元素touchcancel事件句柄上使用ontouchcancel 事件

+ +
<html>
+<script>
+function cancelTouch(ev) {
+ // 事件执行过程
+}
+function init() {
+ var el=document.getElementById("target1");
+ el.ontouchcancel = cancelTouch;
+}
+</script>
+<body onload="init();">
+<div id="target1"> Touch me ... </div>
+<div id="target2" ontouchcancel="cancelTouch(event)"> Touch me ... </div>
+</body>
+</html>
+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Touch Events 2','#widl-GlobalEventHandlers-ontouchcancel')}}{{Spec2('Touch Events 2')}}Non-stable version.
+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support     
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewChrome for AndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
Basic support        
+
+ +

参见

+ + -- cgit v1.2.3-54-g00ecf