gpt4 book ai didi

javascript - 轮播指示器不工作

转载 作者:行者123 更新时间:2023-12-03 06:35:07 24 4
gpt4 key购买 nike

我制作了一个包含 6 张照片的轮播,但下面的轮播指示器不起作用。仅当单击前三个轮播指示器时,才会将我带到正确的幻灯片(单击第一个指示器将我带到第一张幻灯片)。单击最后三个指示器不会导致轮播发生任何变化。我哪里出错了?

<div class="container">
<div class="row">
<div class="col-md-12">
<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>
<li data-target="#carousel" data-slise-to="3"></li>
<li data-target="#carousel" data-slise-to="4"></li>
<li data-target="#carousel" data-slise-to="5"></li>
<li data-target="#carousel" data-slise-to="6"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="Taking%20control.png" class="cimg2">
</div>
<div class="carousel-caption">
<h1>Race info to go here</h1>
</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="smile.png" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="question-mark.png" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="pulp%20fiction.jpg" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="max.jpg" class="cimg">
<img src="look%20to%20your%20left.jpg" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="lewis-hamilton.jpg" class="cimg">
<img src="le%20Ferrari.jpg" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
</div>
</div>
</div>

最佳答案

您有一个拼写错误:使用 data-slide-to 而不是 data-slise-to

<div class="container">
<div class="row">
<div class="col-md-12">
<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>
<li data-target="#carousel" data-slide-to="3"></li>
<li data-target="#carousel" data-slide-to="4"></li>
<li data-target="#carousel" data-slide-to="5"></li>
<li data-target="#carousel" data-slide-to="6"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="Taking%20control.png" class="cimg2">
</div>
<div class="carousel-caption">
<h1>Race info to go here</h1>
</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="smile.png" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="question-mark.png" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="nico-rosberg.jpg" class="cimg">
<img src="pulp%20fiction.jpg" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="max.jpg" class="cimg">
<img src="look%20to%20your%20left.jpg" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
<div class="item">
<div class="row-fluid">
<img src="lewis-hamilton.jpg" class="cimg">
<img src="le%20Ferrari.jpg" class="cimg2">
</div>
<div class="carousel-caption">

</div>
</div>
</div>
</div>
</div>

关于javascript - 轮播指示器不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38262958/

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