gpt4 book ai didi

jquery - foreach 引导 Accordion

转载 作者:行者123 更新时间:2023-12-01 08:38:25 26 4
gpt4 key购买 nike

我正在尝试使这个东西与 this one 相同。我已经打印了。但崩溃消耗不起作用。

<div class="bs-example">
<div class="panel-group" id="accordion">
@foreach($faqs as $faq)
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">{{ $faq->title }}</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<p>{{ $faq->description }}</p>
</div>
</div>
</div>
@endforeach
</div>

最佳答案

假设您正确导入了依赖项,这应该可以工作(使 ids 唯一):

<div class="bs-example">
<div class="panel-group" id="accordion">
@foreach($faqs as $index => $faq)
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse-{{ $index }}">{{ $faq->title }}</a>
</h4>
</div>
<div id="collapse-{{ $index }}" class="panel-collapse collapse in">
<div class="panel-body">
<p>{{ $faq->description }}</p>
</div>
</div>
</div>
@endforeach
</div>

关于jquery - foreach 引导 Accordion ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50479606/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com