forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.isPropagationStopped.xml
37 lines (36 loc) · 1.14 KB
/
event.isPropagationStopped.xml
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
<?xml version="1.0"?>
<entry type="method" name="event.isPropagationStopped" return="Boolean">
<title>event.isPropagationStopped()</title>
<signature>
<added>1.3</added>
</signature>
<desc> Returns whether <a href="/event.stopPropagation/">event.stopPropagation()</a> was ever called on this event object. </desc>
<longdesc>
<p>This event method is described in the <a href="https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/events.html#Events-Event-isPropagationStopped">W3C DOM Level 3 specification</a>.</p>
</longdesc>
<example>
<desc>Checks whether event.stopPropagation() was called</desc>
<code><![CDATA[
function propStopped( event ) {
var msg = "";
if ( event.isPropagationStopped() ) {
msg = "called";
} else {
msg = "not called";
}
$( "#stop-log" ).append( "<div>" + msg + "</div>" );
}
$( "button" ).click(function(event) {
propStopped( event );
event.stopPropagation();
propStopped( event );
});
]]></code>
<html><![CDATA[
<button>click me</button>
<div id="stop-log"></div>
]]></html>
</example>
<category slug="events/event-object"/>
<category slug="version/1.3"/>
</entry>