怎样区别stopPropagation()与stopImmediatePropagation()

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/01 06:49:32

怎样区别stopPropagation()与stopImmediatePropagation()
怎样区别stopPropagation()与stopImmediatePropagation()

怎样区别stopPropagation()与stopImmediatePropagation()
另外加了一个监听 stopImmediatePropagation然后再换成stopPropagation 试试就知道区别了
简而言之 stopImmediatePropagation和stopPropagation都能阻挡掉事件流中事件的冒泡
但是stopImmediatePropagation 会让当前对象(不仅parent了)的次优先级的所有监听都不执行