gpt4 book ai didi

php - 如何激活循环选项卡 PHP

转载 作者:行者123 更新时间:2023-11-28 04:23:26 25 4
gpt4 key购买 nike

我不知道如何在 php 上循环和激活选项卡。一次只激活一个选项卡。

我的标签

enter image description here

<div class="container content">
<div class="row tab-v3">
<div class="col-sm-3">
<?php do { ?>
<ul class="nav nav-pills nav-stacked">
<li><a href="#<?php echo $row_menulist['mlname']; ?>" data-toggle="tab"><i></i><?php echo $row_menulist['mlname']; ?></a></li>
</ul>
<?php } while ($row_menulist = mysql_fetch_assoc($menulist)); ?>
</div>
<div class="col-sm-9">
<div class="tab-content">
<div class="tab-pane fade in active" id="<?php echo $row_menulist['mlname']; ?>">
<?php do { ?>
<h4><?php echo $row_info['mlname']; ?></h4>
<p><?php echo $row_info['detail']; ?></p>
<?php } while ($row_info = mysql_fetch_assoc($info)); ?>
</div>
</div>
</div>
</div>
</div>

最佳答案

删除事件类,我假设循环中的更改不会影响设计。

<div class="container content">
<div class="row tab-v3">
<div class="col-sm-3">
<?php do { ?>
<ul class="nav nav-pills nav-stacked">
<li><a href="#<?php echo $row_menulist['mlname']; ?>" data-toggle="tab"><i></i><?php echo $row_menulist['mlname']; ?></a></li>
</ul>
<?php } while ($row_menulist = mysql_fetch_assoc($menulist)); ?>
</div>
<div class="col-sm-9">
<div class="tab-content">
<?php $count = 1; do { ?>
<div class="tab-pane fade in <?php if($count == '1') { echo 'active'; } ?>" id="<?php echo $row_menulist['mlname']; ?>">

<h4><?php echo $row_info['mlname']; ?></h4>
<p><?php echo $row_info['detail']; ?></p>

</div>
<?php $count++; } while ($row_info = mysql_fetch_assoc($info)); ?>
</div>
</div>
</div>
</div>

关于php - 如何激活循环选项卡 PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42085644/

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