请检查以下示例。当单击弹出按钮时,可折叠功能不起作用。如何停止。 html
<div class="panel panel-info">
<div class="panel-heading collapsed" data-toggle="collapse" data-target="#bar">
<i class="fa fa-fw fa-chevron-down"></i>
<i class="fa fa-fw fa-chevron-right"></i>Foo
<button>
Popup button
</button>
</div>
<div class="panel-body">
<!-- The inside div eliminates the 'jumping' animation. -->
<div class="collapse" id="bar">
Bar.
</div>
</div>
</div>
答案 0 :(得分:0)
您必须在click
函数中监听事件并添加stopPropagation
$(".popup").click(function(e) {
alert("fasfsa");
e.stopPropagation();
});