gpt4 book ai didi

html - 我的 Bootstrap 轮播不工作

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

我正在尝试 Bootstrap 轮播,但它就是行不通。我做了很多研究并一次又一次地检查,但它仍然行不通。谁能告诉我为什么?(我刚开始,所以非常感谢一些详细的解释)

这是我的代码。

<div class="container-fluid">
<div class="carousel slide" data-ride="carousel" id="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide to="0" class="active"></li>
<li data-target="#carousel" data-slide to="1"></li>
<li data-target="#carousel" data-slide to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="https://f1.media.brightcove.com/8/4495439099001/4495439099001_5325814229001_5305215728001-vs.jpg?pubId=4495439099001&videoId=5305215728001">
</div>
<div class="item">
<img src="http://www.asianews.it/files/img/INDIA_-_0907_-_Vescovo_di_Vasai_su_MT.jpg">
</div>
<div class="item">
<img src="https://www.crossroadsinitiative.com/wp-content/uploads/2016/02/Mother-Teresa-of-Calcutta-Mother-Teresas-National-Prayer-Breakfast-Message.jpg">
</div>
</div>
<a class="carousel-control left" href="#carousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="carousel-control right" href="#carousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>

最佳答案

添加 BootstrapjQuery CDN 后,

看来你的轮播工作正常,

您必须检查其中一项:

  • 如果没有,请添加 jQuery 引用。
  • 如果您已经有 jQuery,请确保它在 bootstrap javascript 之前。
  • 如果下载了 bootstrap 和 jQuery 并且您在本地安装了它们,请确保您使用的是正确的文档链接。

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<div class="container-fluid">
<div class="carousel slide" data-ride="carousel" id="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide to="0" class="active"></li>
<li data-target="#carousel" data-slide to="1"></li>
<li data-target="#carousel" data-slide to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="https://f1.media.brightcove.com/8/4495439099001/4495439099001_5325814229001_5305215728001-vs.jpg?pubId=4495439099001&videoId=5305215728001">
</div>
<div class="item">
<img src="http://www.asianews.it/files/img/INDIA_-_0907_-_Vescovo_di_Vasai_su_MT.jpg">
</div>
<div class="item">
<img src="https://www.crossroadsinitiative.com/wp-content/uploads/2016/02/Mother-Teresa-of-Calcutta-Mother-Teresas-National-Prayer-Breakfast-Message.jpg">
</div>
</div>
<a class="carousel-control left" href="#carousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="carousel-control right" href="#carousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>

关于html - 我的 Bootstrap 轮播不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47736677/

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