我剛在Laravel的付款視圖中插入了引導摺疊。 Bootstrap在我點擊它時崩潰,但我希望它自動摺疊。Bootstrap摺疊不會自動摺疊
我知道我必須設置這樣:aria-expanded="false"
但它仍然沒有工作。也許是因爲它有這樣的自己的ID?
href="#collapse{{ $charity->id }}"
這裏是我完整的液晶面板片段:
@foreach($charities as $charity)
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{ $charity->id }}" aria-expanded="false" aria-controls="collapseOne">
<div class="row">
<div class="col-xs-3 col-sm-2 col-md-2">
<img class="media-object" src="{{ $charity->photo }}" width="75px" height="65px" alt="{{ $charity->name }}">
</div>
<div class="col-xs-9 col-sm-10 col-md-10">
{{ $charity->name }}
</div>
</div>
</a>
</h4>
</div>
<div id="collapse{{ $charity->id }}" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
{{ $charity->description }}
</div>
</div>
</div>
</div>
@endforeach
嘗試從'ID = 「崩潰{{$ charity-> ID}}」' –