aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/event/stoppropagation/index.html
blob: 9fb6fef5c27691f8c559bad3823b0d7d45dfb800 (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
---
title: Event.stopPropagation()
slug: Web/API/Event/stopPropagation
tags:
  - API
  - Evento
  - Referencia
  - Referência(2)
  - metodo
  - stopPropagation
translation_of: Web/API/Event/stopPropagation
---
<p id="Summary">{{APIRef("DOM")}}</p>

<h2 id="Summary" name="Summary">Resumo</h2>

<p>Impede a propagação do evento por seus respectivos listeners.</p>

<h2 id="Syntax" name="Syntax">Sintaxe</h2>

<pre class="syntaxbox notranslate"><em>event</em>.stopPropagation();</pre>

<h3 id="Parametros">Parametros</h3>

<p>Nenhum</p>

<h3 id="Valor_retornado">Valor retornado</h3>

<p><code>undefined</code>.</p>

<h2 id="Example" name="Example">Exemplo</h2>

<p>Veja o exemplo 5: <a href="https://developer.mozilla.org/en-US/docs/DOM/DOM_Reference/Examples#Example_5:_Event_Propagation" title="Gecko_DOM_Reference/Examples#Example_5:_Event_Propagation">Event Propagation</a> no capítulo Eventos para um exemplo mais detalhado desse método e propagação de evento no DOM.</p>

<h2 id="Notes" name="Notes">Notas</h2>

<p>Veja <a class="external" href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture">DOM specification</a> para a explicação do fluxo de eventos. (O <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-flow" title="http://www.w3.org/TR/DOM-Level-3-Events/#event-flow">DOM Level 3 Events draft</a> possui uma ilustração.)</p>

<p><a href="/en-US/docs/Web/API/event.preventDefault" title="/docs/Web/API/event.stopPropagation">preventDefault</a> é um método de complemento que pode ser usado para previnir a ação padrão do evento que estiver acontecendo.</p>

<h2 id="Specification" name="Specification">Especificação</h2>

<p><a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-event-type-stopPropagation">DOM Level 3 Events: stopPropagation</a></p>

<h2 id="Browser_compatibility">Compatibilidade com navegadores</h2>

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

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

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Recurso</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown()}}</td>
   <td>{{CompatVersionUnknown()}}</td>
   <td>{{CompatUnknown()}}</td>
   <td>{{CompatVersionUnknown()}}</td>
   <td>{{CompatVersionUnknown()}}</td>
  </tr>
 </tbody>
</table>
</div>