我试图在我的网站上实现这个4图像滑块,但由于某种原因,一次只显示一个图像.
我复制粘贴代码:
http://www.bootply.com/94452
出于某种原因,只有一个图像占据为4个图像保留的空间.当您按下右箭头或等待间隔时,它会转到第二张图像.
有谁知道为什么会这样?
解决方法:
如果你想一次滚动4个图像然后你的图像没有正确嵌套.只需使用这个代码,它应该工作正常.
<div class="col-md-12 text-center"><h3>Bootstrap 3 Multiple Slide Carousel</h3></div>
<div class="col-md-6 col-md-offset-3">
<div class="carousel slide" id="myCarousel">
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=1" class="img-responsive"></a></div>
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=2" class="img-responsive"></a></div>
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=3" class="img-responsive"></a></div>
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=4" class="img-responsive"></a></div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=5" class="img-responsive"></a></div>
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=6" class="img-responsive"></a></div>
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=7" class="img-responsive"></a></div>
<div class="col-xs-3"><a href="#"><img src="http://placehold.it/500/e499e4/fff&text=8" class="img-responsive"></a></div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><i class="glyphicon glyphicon-chevron-left"></i></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><i class="glyphicon glyphicon-chevron-right"></i></a>
</div>
</div>