jQuery-StopPropagation在带有实时事件的表tr中不起作用 [英] Jquery - stopPropagation is not working in table tr with live event
问题描述
请检查下面的JS小提琴链接,
http://jsfiddle.net/smanimani/ENJBs/27/
实际上我的需要是,我在所有TR行的每个第一个TD中都有一个 link 按钮.要在链接按钮中显示该新行,请单击...
检查上面的链接...当我们单击第一行时,新行将完美显示&此外,当我们单击链接按钮时,不会显示新行. 但是,当我们在第二行中执行相同的操作时,单击链接按钮时会显示新行.
当我们点击链接按钮时,我不想显示该新行...
我该如何解决?
您不能通过.live()
方法在事件处理程序中使用event.stopPropagation()
.
在事件处理程序中调用event.stopPropagation()在以下情况下无效 停止附加在文档下方的事件处理程序;该事件有 已经传播到文档.
Please check the below JS Fiddle link,
http://jsfiddle.net/smanimani/ENJBs/27/
Actually my need is, I have a link button in every first TD in all TR row.. When we click a table row, want to display a new row after clicked row, but i dont want to display that new row in link button click...
Check the above link... When we click first row, the new row will be diplaying perfectly & also when we click link button new row is not displayed.... But when we do the same operation in 2nd row, the new row is displayed when click link button....
i dont want to display that new row, when we click link button...
How to i solve this?
You can't use event.stopPropagation()
in the event handler with .live()
method.
Calling event.stopPropagation() in the event handler is ineffective in stopping event handlers attached lower in the document; the event has already propagated to document.
这篇关于jQuery-StopPropagation在带有实时事件的表tr中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!