-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathevent.stopPropagation.xml
More file actions
20 lines (19 loc) · 985 Bytes
/
event.stopPropagation.xml
File metadata and controls
20 lines (19 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<entry type='method' name="event.stopPropagation" return="">
<signature>
<added>1.0</added>
</signature>
<desc>Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. </desc>
<longdesc> <p>We can use <code><a href="/event.isPropagationStopped">event.isPropagationStopped()</a></code> to determine if this method was ever called (on that event object). </p>
<p>This method works for custom events triggered with <a href="/trigger">trigger()</a>, as well.</p>
<p>Note that this will not prevent other handlers <em>on the same element</em> from running. </p> </longdesc>
<note id="propagation-for-live-or-delegate" type="additional"></note>
<example>
<desc>Kill the bubbling on the click event.</desc>
<code><![CDATA[$("p").click(function(event){
event.stopPropagation();
// do something
}); ]]></code>
</example>
<category slug="events/event-object"/>
<category slug="version/1.0"/>
</entry>