使用jQuery捕获事件 [英] event capturing with jQuery
问题描述
jQuery使用事件冒泡,但有没有办法进行事件捕获,即按照解释的降序排列这里
jQuery uses event bubbling, but is there a way to do event capturing ie in the descending order as explained here
具体情况如下:主持人A&主机B位于同一个域中,例如:
www.mydomain.com
和 xxx.mydomain.com
。
当然,同源策略使得无法在iframe中触发事件。但是我想知道用户是否点击 $('#hostA')
并将事件传递给< iframe>
。
The specific case is the following where host A & host B are on the same domain like :
www.mydomain.com
and xxx.mydomain.com
.
Of course the Same Origin Policy makes it that it is not possible to trigger on event in the iframe. However I just would like to know if user has clicked on $('#hostA')
and pass on the event to the <iframe>
.
< div id =hostA>
< iframe id =hostB>
< / div>
推荐答案
不,jQuery不支持这个,它永远不会 - IE无法实现捕获事件。
No, jQuery does not support this and it never can -- IE has no way to implement a capturing event.
这篇关于使用jQuery捕获事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!