我正在尝试在转盘中制作转盘,以便可以动态加载较大的部分并使所有内容井井有条,目前我正尝试在转盘中对转盘进行硬编码,但是第三张幻灯片存在问题没有显示,我无法弄清楚为什么有人有任何建议。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<style>
/* Make the image fully responsive */
.carousel-inner img {
width: 25%;
height: 25%;
}
</style>
</head>
<body>
<div id="demo1" class="carousel slide" data-ride="carousel" data-interval="false">
<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo1" data-slide-to="0" class="active"></li>
<li data-target="#demo1" data-slide-to="1"></li>
<li data-target="#demo1" data-slide-to="2"></li>
</ul>
<!-- The slideshow -->
<div class="carousel-inner text-center" style="background-color: #3a3b45">
<div class="carousel-item active">
<img src="img/logo.png" alt="Los Angeles">
</div>
<div class="carousel-item">
<!--Carousel 2-->
<!--<img src="img/logo.png" alt="Los Angeles">-->
<div id="demo2" class="carousel slide" data-ride="carousel" data-interval="false">
<ul class="carousel-indicators mb-4">
<li data-target="#demo2" data-slide-to="0" class="active"></li>
<li data-target="#demo2" data-slide-to="1"></li>
<li data-target="#demo2" data-slide-to="2"></li>
</ul>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/logo.png" alt="Los Angeles">
</div>
<div class="carousel-item">
<img src="img/logo.png" alt="Chicago">
</div>
<div class="carousel-item">
<img src="img/logo.png" alt="New York">
</div>
</div>
</div>
<!--Carousel 2 END-->
</div>
<div class="carousel-item">
<img src="img/logo.png" alt="New York">
</div>
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo1" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo1" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</body>
</html>
答案 0 :(得分:1)
尽管在bootstrap 4的文档中提到了-
但是,我正在尝试,很久以前我想这样做,现在看到您的问题让我重试,如果可以,我会在这里告诉您,直到您可以从我停下来的地方开始今天-(请访问评论中的链接)
好运。