jQuery event.isPropagationStopped() 方法
示例
检查是否调用了 event.stopPropagation()
$("div").click(function(event){
event.stopPropagation();
alert(event.isPropagationStopped());
});
自己动手试一试 »
定义和用法
event.isPropagationStopped() 方法检查是否为事件调用了 event.stopPropagation()。
如果调用了 event.stopPropagation(),此方法将返回 true,否则返回 false。
语法
event.isPropagationStopped()
参数 | 描述 |
---|---|
事件 | 必需。 event 参数来自事件绑定函数。 |