gpt4 book ai didi

javascript - Bootstrap 轮播不滑动

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

我完全不明白为什么 Bootstrap 轮播代码对我根本不起作用。很奇怪,我拿了 bootstrap 网站上的例子,只是定制了一些它应该工作的小东西。我认为这是 bootrstrap 或 jquery 版本的问题,但它们都是我发现的最后一个,所以我看不出问题出在哪里。如果有人能帮助我,请^^

#carouselReactions {
margin-top: 25px;
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
height: auto;
}

#carousel-left-control {
width: 5%;
display: flex;
justify-content: center;
align-items: center;
}

#carousel-text {
width: 50%;
height: auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

#carousel-text h3 {
color: #0C0C0D;
}

.carousel-inner, .carousel-item {
position: relative;
text-align: center;
}

#carousel-right-control {
width: 5%;
display: flex;
justify-content: center;
align-items: center;
}

.carousel-indicators {
margin-top: 15px;
padding: 0;
float: none;
position: relative;
}
.carousel-control-prev, .carousel-control-next {
position: relative;
}
.carousel-control-next, .carousel-control-prev {
width: 100%;
height: 100%;
}
.carousel-control-prev-icon, .carousel-control-next-icon {
height: 50%;
width: 40%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div id="carouselReactions" class="carousel slide" data-ride="carousel">
<div id="carousel-left-control">
<a class="carousel-control-prev" href="#carouselReactions" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
</div>
<div id="carousel-text">
<div class="carousel-inner">
<div class="carousel-item active">
<h3>« First quote »</h3>
<img src="img/logo_quote1.png">
<p>QuoteAuthor</p>
</div>
<div class="carousel-item">
<h3>Second Quote</h3>
<img src="img/logo_quote2.png">
<p>QuoteAuthor2</p>
</div>
<div class="carousel-item">
<h3>Third Quote</h3>
<img src="img/logo_quote3.png">
<p>QuoteAuthor3</p>
</div>
</div>
</div>

<div id="carousel-right-control">
<a class="carousel-control-next" href="#carouselReactions" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>

最佳答案

只需将您的引用 CDN 更改为以下,然后您一定不会再有任何问题。

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<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.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>

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

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