">" al-6ren">
gpt4 book ai didi

php - 我如何在 opencart 中使用 Bootstrap slider

转载 作者:太空宇宙 更新时间:2023-11-04 13:54:23 25 4
gpt4 key购买 nike

有没有人用 opencart slideshow 模块试用 bootstrap slide?

这是我正在尝试但获取所有事件类的代码。有人可以帮助我。

<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<div class="carousel-inner slideshow <?php echo $module; ?>">
<div class="item active">

<?php foreach ($banners as $banner) { ?>
<?php if ($banner['link']) { ?>
<a href="<?php echo $banner['link']; ?>"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></a>
<?php } else { ?>
<img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" />
<?php } ?>
<?php } ?>
</div>

<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>

</div>
</div>

最佳答案

UPD:循环必须是这样的

<div class="carousel slide" data-ride="carousel">
<div class="carousel-inner slideshow<?php echo $module; ?>">
<?php foreach ($banners as $banner) { ?>
<?php if ($banner['link']) { ?>
<div class="item"><a href="<?php echo $banner['link']; ?>"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></a></div>
<?php } else { ?>
<div class="item"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></div>
<?php } ?>
<?php } ?>
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"><span class="bootstrap_left"></span></a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"><span class="bootstrap_right"></span></a>

</div>
</div>

和jquery

<script type="text/javascript"><!--
$(document).ready(function() {
$('.item:first-child').addClass('active');
$('.carousel').carousel();
});
--></script>

关于php - 我如何在 opencart 中使用 Bootstrap slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22003428/

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