gpt4 book ai didi

javascript - Bootstrap轮播不滑动

转载 作者:行者123 更新时间:2023-12-02 22:26:52 26 4
gpt4 key购买 nike

我正在尝试使用引导轮播,但它只显示图片,幻灯片不起作用。关于这个主题的其他旧问题并没有引导我找到正确的解决方案。我做错了什么?我不知道如何处理 jquery,我想

<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="img/123.jpg" alt="First slide">
<div class="container">
<div class="carousel-caption text-left">
<div align="center">
<p>Hier kommen Sie zur Übersicht unserer Zimmer</p>
<p><a th:href="@{/catalog/}" class="btn btn-primary">Zimmerbuchen</a></p>
</div>
</div>
<div class="carousel-item">
<img class="d-block w-100" src="img/1234.jpeg" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="12345.jpeg" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</body>
</html>

最佳答案

你有像这样初始化你的轮播吗?

<!-- Calling jquery first -->
<script language="JavaScript" type="text/javascript" src="scripts/jquery.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/bootstrap.min.js"></script>
<!-- Carousel -->
<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
$('.carousel').carousel({
interval: 3000
})
});
</script>

关于javascript - Bootstrap轮播不滑动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59039414/

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