aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/orphaned/web/api/uievent/cancelbubble/index.html
blob: f98af92c97ba6e45855702fd2d65df53ed6c8a51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
title: event.cancelBubble
slug: orphaned/Web/API/UIEvent/cancelBubble
translation_of: Web/API/UIEvent/cancelBubble
original_slug: Web/API/UIEvent/cancelBubble
---
<p>{{ ApiRef() }}</p>
<div class="warning">
 <strong>警告:</strong> 请使用 <a href="/zh-cn/DOM/event.stopPropagation" title="zh-cn/DOM/event.stopPropagation">event.stopPropagation()</a> 方法来代替该不标准的属性.</div>
<h3 id="Summary" name="Summary">概述</h3>
<p>{{ Deprecated_header() }} 获取或设置一个布尔值,表明当前事件是否要取消冒泡.</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<pre class="eval">event.cancelBubble = <em>bool;</em>
<em>var bool</em> = event.cancelBubble;
</pre>
<p><code>bool</code> 的值为<code>true或</code><code>false</code>.</p>
<h3 id="Notes" name="Notes">备注</h3>
<p><code>如果一个事件是可冒泡的,则它的cancelBubble</code>属性的默认值为 <code>false</code>,代表允许该事件向上冒泡. 将<code>cancelBubble</code>属性设置为<code>true以后,可以阻止该事件的进一步冒泡行为.</code></p>
<p>{{ languages( { "pl": "pl/DOM/event.cancelBubble" ,"en": "en/DOM/event.cancelBubble" } ) }}</p>