gpt4 book ai didi

html - 引导 slider 不滑动

转载 作者:行者123 更新时间:2023-11-28 19:15:31 27 4
gpt4 key购买 nike

我想使用 bootstrap carousel 制作一个 slider ,但我的 slider 不滑动即使我点击按钮也不会滑动

我测试了很多其他的 bootstrap slider ,我也遇到了同样的问题,我在堆栈溢出中发现了很多问题,但它们都是 javascript

<div class="container">
<div class="main">
<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">
<a href="hkh.html">
<div class="carousel-item ">
<img class="d-block w-100" src="https://fortniteinsider.com/wp-content/uploads/2019/10/Fortnite-Chapter-2-Season-1-Loading-Screen-Leaked-2.jpg" alt="Third slide">
<div class="slidetoppage">
</div>
<div class="carousel-caption d-none d-md-block">
<h5>test title 3</h5>
<p>test desc</p>
</div>
</div>
</a>
<a href="gh.php">
<div class="carousel-item ">
<img class="d-block w-100" src="https://assets.pcmag.com/media/images/668289-fortnite-chapter-2.jpg?thumb=y&width=1280&height=720" alt="First slide">
<div class="slidetoppage">
</div>
<div class="carousel-caption d-none d-md-block">
<h5>test title 2</h5>
<p>test desc</p>
</div>
</div>
</a>
<a href="gooz.php">
<div class="carousel-item active">
<img class="d-block w-100" src="https://assets.pcmag.com/media/images/668289-fortnite-chapter-2.jpg?thumb=y&width=1280&height=720" alt="Second slide">
<div class="slidetoppage">
</div>
<div class="carousel-caption d-none d-md-block">
<h5>test title 1</h5>
<p>test desc</p>
</div>
</div>
</a>
<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>
</div>
</div>
</div>

最佳答案

您应该包含您的 js 文件。如下所示;

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

这也是 bootstrap 的链接,它在一开始就解释了要做什么:Bootstrap Introduction

关于html - 引导 slider 不滑动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58454537/

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