1

one button is in heart of other button , if set a function to parent of button child button instead of do itself action do parent ,

--------------------------------------------
|   ----------                             |
|   | Child  |  Parent (class="btn")       |
|   ----------                             |
--------------------------------------------

if $(".btn").click(function () { return false; }); child return false too ! not navigate to it's own Link !

Added : it happen within any Clickable element like button in div , div in div , any Hierarchy structure, not just button in button , it`s just sample

4

1 回答 1

6

这称为事件传播。在http://api.jquery.com/event.stopPropagation阅读更多内容。

于 2013-09-05T08:15:39.830 回答