目前我正在使用这样的手风琴,我有可以点击的glyphicon箭头展开/折叠它。 :http://www.bootply.com/1fDNAjGFrJ
$('[data-toggle="collapse"]').click(function() {
$(this).children(".glyphicon").toggleClass("glyphicon-chevron-up glyphicon-chevron-down");
});
<div class="container">
<div class="panel-group" id="accordionMessagesSetup">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionMessagesSetup" href="#collapseMessagesSetup">
<span class="glyphicon glyphicon-chevron-up"></span>
Message Setup
</a>
</h4>
</div>
<div id="collapseMessagesSetup" class="panel-collapse collapse in">
<div>
Actual Content goes here
</div>
</div>
</div>
</div>
</div>
可点击区域目前只是该图标。如何扩展它以使整个panel-title
部分可点击?
答案 0 :(得分:2)
只是一个简单的CSS案例,让a
成为block
并使用padding
来填充标题:
.accordion-toggle {
display: block;
padding: 10px 15px;
}
.panel-heading {
padding: 0;
}
答案 1 :(得分:1)
只需将此添加到您的css
即可.accordion-toggle{
display: block;
}
答案 2 :(得分:1)