aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/gestureevent/index.html
blob: 80ad1fc3905cf43a55f99976b9945656e5ac320f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: GestureEvent
slug: Web/API/GestureEvent
translation_of: Web/API/GestureEvent
---
<p id="Summary">{{APIRef("DOM Events")}}</p>

<p>{{Non-standard_header()}}</p>

<p><code><strong>GestureEvent</strong></code> 是 WebKit 的专有接口,提供多点触控的信息。这个接口的事件包括 {{event("gesturestart")}}, {{event("gesturechange")}}{{event("gestureend")}}.</p>

<p><code>GestureEvent</code> 继承自 {{domxref("UIEvent")}},后者又继承自{{domxref("Event")}}</p>

<h2 id="构造函数">构造函数</h2>

<dl>
 <dt>{{domxref("GestureEvent.GestureEvent", "GestureEvent()")}}</dt>
 <dd>Creates a <code>GestureEvent</code> object.</dd>
</dl>

<h2 id="属性">属性</h2>

<p><em>This interface also inherits properties of its parents, {{domxref("UIEvent")}} and {{domxref("Event")}}.</em></p>

<dl>
 <dt>{{domxref("GestureEvent.rotation")}} {{readonlyinline}}</dt>
 <dd>Change in rotation (in degrees) since the event's beginning. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. Initial value: <code>0.0</code></dd>
 <dt>{{domxref("GestureEvent.scale")}} {{readonlyinline}}</dt>
 <dd>Distance between two digits since the event's beginning. Expressed as a floating-point multiple of the initial distance between the digits at the beginning of the gesture. Values below 1.0 indicate an inward pinch (zoom out). Values above 1.0 indicate an outward unpinch (zoom in). Initial value: <code>1.0</code></dd>
</dl>

<h2 id="方法">方法</h2>

<p><em>This interface also inherits methods of its parents, {{domxref("UIEvent")}} and {{domxref("Event")}}.</em></p>

<dl>
 <dt>{{domxref("GestureEvent.initGestureEvent()")}}</dt>
 <dd>Initializes the value of an <code>GestureEvent</code>. If the event has already being dispatched, this method does nothing.</dd>
</dl>

<h2 id="手势事件类型">手势事件类型</h2>

<ul>
 <li>{{event("gesturestart")}}</li>
 <li>{{event("gesturechange")}}</li>
 <li>{{event("gestureend")}}</li>
</ul>

<h2 id="规范">规范</h2>

<p><em>不属于任何规范。苹果在<a href="https://developer.apple.com/library/iad/documentation/UserExperience/Reference/GestureEventClassReference/index.html">Safari Developer Library</a>中描述了这个接口。</em></p>

<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>

<p><br>
 {{Compat("api.GestureEvent")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li>{{domxref("MSGestureEvent")}}</li>
 <li>{{event("MSGestureStart")}}</li>
 <li>{{event("MSGestureEnd")}}</li>
 <li>{{event("MSGestureTap")}}</li>
 <li>{{event("MSGestureHold")}}</li>
 <li>{{event("MSGestureChange")}}</li>
 <li>{{event("MSInertiaStart")}}</li>
</ul>