这种方法工作正常,直到我突然发现它不再发生变化,我似乎无法找到问题,这可能非常明显。
HTML:
<div class="panel">
<div class="accordion-heading">
<h4 data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<span class="up"> </span>Ons team
</h4>
</div>
<div id="collapseOne" class="accordion-body collapse">
<div class="accordion-inner">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
</p>
</div>
</div>
</div>
jQuery的:
$('.collapse').on('shown.bs.collapse', function(){
$(this).parent().find(".up").removeClass("up").addClass("down");
}).on('hidden.bs.collapse', function(){
$(this).parent().find(".down").removeClass("down").addClass("up");
});