blob: 4a495fc6726a42b363faace31ab63eb71092312a (
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
|
---
title: Event.bubbles
slug: Web/API/Event/bubbles
translation_of: Web/API/Event/bubbles
---
<p>{{ ApiRef("DOM") }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<p>表示事件是否會向上冒泡傳遞。</p>
<h3 id="語法">語法</h3>
<pre class="eval"><em>var bool</em> = event.bubbles;
</pre>
<p>回傳一個布林值,若事件會向上冒泡傳遞則回傳 <code>true</code>。</p>
<h3 id="Notes" name="Notes">備註</h3>
<p>Only certain events can bubble. Events that do bubble have this property set to <code>true</code>. You can use this property to check if an event is allowed to bubble or not.</p>
<h3 id="Example" name="Example">範例</h3>
<pre class="brush: js"> function goInput(e) {
// checks bubbles and
if (!e.bubbles) {
// passes event along if it's not
passItOn(e);
}
// already bubbling
doOutput(e)
}
</pre>
<h2 id="Specifications" name="Specifications">規範</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('DOM WHATWG', '#dom-event-bubbles', 'Event.bubbles')}}</td>
<td>{{ Spec2('DOM WHATWG') }}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('DOM4', '#dom-event-bubbles', 'Event.bubbles')}}</td>
<td>{{ Spec2('DOM4') }}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('DOM2 Events', '#Events-Event-canBubble', 'Event.bubbles')}}</td>
<td>{{ Spec2('DOM2 Events') }}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
|