https://jsfiddle.net/u2ay67Lo/6/
HTML
<div id="accordion2" class="accordion panel-group">
<div class="accordion-group panel panel-default">
<div class="panel-heading accordion-heading">
<a href="#collapse5" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle panel-title">
Lorem ipsum dolor sit amet ..
</a>
</div>
<div class="accordion-body collapse" id="collapse5">
<div class="accordion-inner panel-body">
<div class="row">
<div class="col-md-10">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur blandit faucibus elit nec mollis. Phasellus tempor urna tellus, eget lobortis magna porttitor eget. Sed risus ex, ultrices ac quam at, ultrices feugiat dolor. Mauris nec fermentum arcu.
<br>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Peças escritas e desenhadas (39.5 MB)</a>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Formulário de Participação (101 KB)</a>
</div>
<div class="col-md-2">
<button class="pull-right" href="#">Participa</button>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-group panel panel-default">
<div class="panel-heading accordion-heading">
<a href="#collapse7" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle panel-title">
Donec vitae efficitur magna...
</a>
</div>
<div class="accordion-body collapse" id="collapse7">
<div class="accordion-inner panel-body">
<div class="row">
<div class="col-md-10">
Donec vitae efficitur magna, non iaculis sapien. Pellentesque ut leo turpis. Sed aliquet, lorem vel sollicitudin pretium, sapien augue rutrum risus, eu ultricies risus est in nibh. Etiam molestie non lorem in mollis. Cras non mi tempus, varius elit id,
ultrices diam. Vestibulum bibendum lacus vitae augue interdum, ut ultricies elit aliquam. Fusce rhoncus nunc convallis luctus ornare. Curabitur vulputate posuere ligula in eleifend. Vivamus commodo mi sed felis dignissim, rutrum pharetra odio
varius. Sed vel aliquet tortor. Nunc sit amet nibh eget sem elementum pulvinar. Maecenas et felis at felis venenatis lacinia vitae sit amet nulla.
<br>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Peças escritas e desenhadas (39.5 MB)</a>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Formulário de Participação (101 KB)</a>
</div>
<div class="col-md-2">
<button class="pull-right" href="#">Participa</button>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-group panel panel-default">
<div class="panel-heading accordion-heading">
<a href="#collapse8" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle panel-title">
Maecenas et felis at felis...
</a>
</div>
<div class="accordion-body collapse" id="collapse8">
<div class="accordion-inner panel-body">
<div class="row">
<div class="col-md-10">
Maecenas et felis at felis venenatis lacinia vitae sit amet nulla.Morbi tempor facilisis aliquam. Suspendisse ac velit ut lectus vehicula finibus imperdiet et leo.
<br>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Peças escritas e desenhadas (39.5 MB)</a>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Formulário de Participação (101 KB)</a>
</div>
<div class="col-md-2">
<button class="pull-right" href="#">Button1</button>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-group panel panel-default">
<div class="panel-heading accordion-heading">
<a href="#collapse9" data-parent="#accordion2" data-toggle="collapse" class="accordion-toggle panel-title">
Quisque placerat in dui quis vestibulum. ..
</a>
</div>
<div class="accordion-body collapse" id="collapse9">
<div class="accordion-inner panel-body">
<div class="row">
<div class="col-md-10">
Quisque placerat in dui quis vestibulum. Morbi tempor facilisis aliquam. Suspendisse ac velit ut lectus vehicula finibus imperdiet et leo. Mauris commodo auctor tellus, at lobortis sapien. Class aptent taciti sociosqu ad litora torquent per conubia nostra,
per inceptos himenaeos. Morbi fringilla lectus et urna blandit porta. Aliquam sed dolor gravida tellus pharetra laoreet in vel dolor. Sed cursus lacus vel metus porttitor, sed tempus enim pharetra. Vestibulum malesuada faucibus diam hendrerit
molestie. Aenean eget malesuada ipsum. Phasellus vitae erat at tellus aliquet sollicitudin. Integer nec neque nec felis egestas efficitur. Aliquam sodales est neque, in vulputate orci cursus in. Nunc ac leo suscipit, porttitor tellus non,
fermentum eros. Sed aliquet elit at est consequat, et semper risus porta.
<br>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">File1 (39.5 MB)</a>
<br>
<i aria-hidden="true" class="fa fa-file-pdf-o"></i> <a href="#">Formulário de Participação (101 KB)</a>
</div>
<div class="col-md-2">
<button class="pull-right" href="#">Test</button>
</div>
</div>
</div>
</div>
</div>
</div>
JavaScript
$(function() {
$('a.accordion-toggle').click(function(e) {
e.preventDefault();
if (!$(this).parent().hasClass('accordionPannelActive')) {
$('.accordion-heading').removeClass('accordionPannelActive').find('a').removeClass('accordionPannelActive');
$(this).parent().addClass('accordionPannelActive').find('a').addClass('accordionPannelActive');
} else {
$('.accordion-heading').removeClass('accordionPannelActive').next().removeClass('accordionPannelActive');
$(this).parent().find('a').removeClass('accordionPannelActive');
}
});
});
CSS
.accordionPannelActive {
background-color: #8dc640!important;
color: white !important;
}
a.accordion-title:focus {
color: inherit;
text-decoration: none;
}
.panel-default > .panel-heading {
background-image: none;
}
a.accordion-title:hover {
color: inherit;
background-color: inherit;
text-decoration: none;
}
.panel-default > .panel-heading {
background-image: none;
}
.panel-title{
display:block;
}
需求:
jquery.min.js、jquery.min.js、bootstrap.min.css、bootstrap-theme.min.css 和 bootstrap.min.js