我也看着很多地方對這個答案(SIMPLE)
我發現這個
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#jai">
<span class="pull-right"><i class="icon-chevron-up"></i></span>
Jai
</a>
</div>
<div id="jai" class="accordion-body collapse in">
<div >
<div class="accordion-inner">
body content 1
</div>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
<span class="pull-right"><i class="icon-chevron-down"></i></span>
jai2
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div>
<div class="accordion-inner">
body content 2
</div>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse3">
<span class="pull-right"><i class="icon-chevron-down"></i></span>
jai3
</a>
</div>
<div id="collapse3" class="accordion-body collapse">
<div>
<div class="accordion-inner">
body content 3
</div>
</div>
</div>
</div>
// jQuery的--- //你需要有引導程序運行
$('div.accordion-body').on('shown', function() { console.log($(this).parent("div").find(".icon-chevron-down").html());// this will show you html selected
$(this).parent("div").find(".icon-chevron-down").removeClass("icon-chevron-down").addClass("icon-chevron-up");
});
$('div.accordion-body').on('hidden', function() { console.log(this);
$(this).parent("div").find(".icon-chevron-up").removeClass("icon-chevron-up").addClass("icon-chevron-down");
//小提琴手view working example
來源
2013-09-20 00:58:30
jai
我真的很笨!謝謝 :) – mpgn