我正在尝试 Twitter bootstrap 3。我对 HTML、CSS 和 Javascript 还是很陌生。我有一个我创建的轮播,它的代码如下所示:
<div class="container">
<div id="myCarousel2" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<div class="row text-center">
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/buzzbutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/recipebutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/buzzbutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/recipebutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
</div>
</div>
<div class="item">
<div class="row text-center">
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/buzzbutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/recipebutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/buzzbutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
<!-- ITEM-->
<div class="col-md-3">
<div class="thumbnail product-item"> <a class="img-responsive" href="/current-buzz"><img src="{% static 'img/recipebutton.jpg' %}"/></a>
</div>
</div>
<!-- ITEM-->
</div>
</div>
</div>
<!-- /INNER-->
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel2" data-slide="prev"><i class="glyphicon glyphicon-chevron-left"></i></a>
</div>
</div>
现在设置为一次显示 4 张图像。问题是我有8张图片。在上面的轮播中,它一次显示 4 张图像,然后滑到下 4 张。这是 Javascript:
<script type="text/javascript">
$('.carousel.slide').carousel()
</script>
和CSS:
@media (max-width: 767px){
.carousel .row .span3 {
display: block;
float: left;
width: 25%;
margin-left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
}
.carousel .carousel-control { visibility: hidden; }
如何让图像在连续循环中一次只移动一个?