【发布时间】:2018-01-06 23:59:17
【问题描述】:
我正在尝试使用引导程序创建一个响应式轮播缩略图滑块。在桌面没有问题。一切都很好。但是当我调整移动显示窗口的大小时,轮播会在垂直方向上分解列。
我想一次显示一张缩略图,并想一张接一张地显示下一张。
以下是我的工作演示
.collaborators {
background: #0492da;
font-family: 'Work Sans', sans-serif;
color: #fff;
padding: 50px 0;
position: relative;
z-index: 2;
}
.collaborators h1 {
font-size: 50px;
font-weight: 300;
}
.text1 {
font-size: 20px;
}
.carousel-control {
width: auto;
}
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<section class="collaborators">
<div class="container">
<div class="row">
<div class="col-xs-12 text-center">
<h1>Collaborators</h1>
<p class="text1">Based in the Ottawa/Gatineau area, Lead Action specializes primarily in Leadership Development.</p>
</div>
<div class="col-xs-12">
<div id="collaborators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#collaborators" data-slide-to="0" class="active"></li>
<li data-target="#collaborators" data-slide-to="1"></li>
<li data-target="#collaborators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<div class="row">
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
<div class="col-lg-3">
<img src="https://www.w3schools.com/bootstrap/img_chania.jpg" alt="Chania" class="img-responsive">
<div class="carousel-caption">
<h3>Chania</h3>
<p>The atmosphere in Chania has a touch of Florence and Venice.</p>
</div>
</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#collaborators" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#collaborators" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
</section>
【问题讨论】:
-
仍在等待...等待...等待...寻求解决方案。请帮帮我
-
你得到预期的答案了吗?
标签: javascript jquery html css twitter-bootstrap