aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/api/uievent/uievent/index.html
blob: d18be6387fc2747f996de6bbc24eae43e9ed3ab1 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
title: UIEvent()
slug: Web/API/UIEvent/UIEvent
translation_of: Web/API/UIEvent/UIEvent
---
<p>{{APIRef("DOM Events")}}</p>

<p><strong><code>UIEvent()</code></strong> constructor 是用來建立新的 {{domxref("UIEvent")}}</p>

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

<pre class="syntaxbox"> <em>event</em> = new UIEvent(<em>typeArg</em>, <em>UIEventInit</em>);</pre>

<h3 id="參數">參數</h3>

<dl>
 <dt><em>typeArg</em></dt>
 <dd>一個 {{domxref("DOMString")}} ,用來表示事件名稱</dd>
 <dt><em>UIEventInit</em>{{optional_inline}}</dt>
</dl>

<dl>
 <dd>一個 <code>UIEventInit</code> dictionary ,能接受以下參數:

 <table class="standard-table">
  <thead>
   <tr>
    <th>參數</th>
    <th>可選</th>
    <th>默認值</th>
    <th>類型</th>
    <th>說明</th>
   </tr>
  </thead>
  <tbody>
   <tr>
    <td><code>"detail"</code></td>
    <td></td>
    <td><code>0</code></td>
    <td><code>long</code></td>
    <td>定義事件意義的值。關於事件的意義於 {{domxref("UIEvent.detail")}} 已有較詳盡的列表。</td>
   </tr>
   <tr>
    <td><code>"view"</code></td>
    <td></td>
    <td><code>null</code></td>
    <td>{{domxref("WindowProxy")}}</td>
    <td>與事件相關的 {{domxref("Window")}}</td>
   </tr>
  </tbody>
 </table>

 <div class="note">
 <p><em><code>UIEventInit</code> dictionary 亦接受 {{domxref("Event.Event", "EventInit")}} dictionary 所接受的參數。</em></p>
 </div>
 </dd>
</dl>

<h2 id="Specifications" name="Specifications">規格</h2>

<table class="standard-table" style="height: 49px; width: 1000px;">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('DOM3 Events','#interface-UIEvent','UIEvent()')}}</td>
   <td>{{Spec2('DOM3 Events')}}</td>
   <td>原始定義。</td>
  </tr>
 </tbody>
</table>

<h2 id="瀏覽器支援度">瀏覽器支援度</h2>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatGeckoDesktop(11) }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatVersionUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatGeckoMobile(11) }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="延伸閱讀">延伸閱讀</h2>

<ul>
 <li>{{domxref("UIEvent")}},此 constructer 所建立的 object 的 interface。</li>
</ul>