事件冒泡,并停止传播 [英] Event Bubbling, and Stop Propagation

查看:171
本文介绍了事件冒泡,并停止传播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

event.bubbles为false之间的区别对于任何事件设置event.stopPropagation()或stopImmediatePropagation()在处理事件是什么
使用FLEX4与AS3林。

解决方案

设置气泡为false表示该事件不会冒泡了显示列表都没有。

stopPropagation和stopImmediatePropagation使当前事件侦听器的最后一个处理一个事件。

stopPropagation和stopImmediatePropagation之间的区别在于stopImmediatePropagation不仅将prevent从移动到下一个节点的情况下,但它也将prevent从捕获它们的事件在该节点上的任何其他的听众。

What is the difference between event.bubbles to false for any event, And Setting event.stopPropagation() or stopImmediatePropagation() while handling event?
Im using flex4 with as3.

解决方案

Setting bubbles to false means the event does not bubble up the display list at all.

stopPropagation and stopImmediatePropagation make the current event listener the last to process an event.

The difference between stopPropagation and stopImmediatePropagation is that stopImmediatePropagation will not only prevent the event from moving to the next node, but it will also prevent any other listeners on that node from capturing their events.

这篇关于事件冒泡,并停止传播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆