forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.isImmediatePropagationStopped.xml
37 lines (36 loc) · 1.17 KB
/
event.isImmediatePropagationStopped.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.isImmediatePropagationStopped" return="Boolean">
<title>event.isImmediatePropagationStopped()</title>
<signature>
<added>1.3</added>
</signature>
<desc> Returns whether event.stopImmediatePropagation() was ever called on this event object. </desc>
<longdesc>
<p>This property was introduced in <a href="http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107/events.html#Events-Event-isImmediatePropagationStopped">DOM level 3</a>.</p>
</longdesc>
<example>
<desc>Checks whether event.stopImmediatePropagation() was called.</desc>
<code><![CDATA[
function immediatePropStopped( event ) {
var msg = "";
if ( event.isImmediatePropagationStopped() ) {
msg = "called";
} else {
msg = "not called";
}
$( "#stop-log" ).append( "<div>" + msg + "</div>" );
}
$( "button" ).click(function( event ) {
immediatePropStopped( event );
event.stopImmediatePropagation();
immediatePropStopped( 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>