我使用此代码,但它在我的网站上生成一个垂直图像滚动条。我怎么能改变它使它成为水平?我从http://www.bootply.com获取了此代码。
<div class="container">
<div class="col-md-12">
<h1>Bootstrap 3.1.1 Thumbnail Slider</h1>
<div class="well-none">
<div id="myCarousel" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-sm-3 col-xs-6">
<div><div>Header</div><div>Subheader</div></div>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x"><img src="http://placehold.it/500x500" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x"><img src="http://placehold.it/500x500" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x"><img src="http://placehold.it/500x500" alt="Image" class="img-responsive"></a>
</div>
</div>
<!--/row-->
</div>
<!--/item-->
<div class="item">
<div class="row">
<div class="col-sm-3 col-xs-6"><a href="#x col-xs-6" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
</div>
<!--/row-->
</div>
<!--/item-->
<div class="item">
<div class="row">
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
<div class="col-sm-3 col-xs-6"><a href="#x" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" class="img-responsive"></a>
</div>
</div>
<!--/row-->
</div>
<!--/item-->
</div>
<!--/carousel-inner-->
<a class="left carousel-control" href="#myCarousel" data-slide="prev"><i class="fa fa-chevron-left fa-4"></i></a>
<a class="right carousel-control" href="#myCarousel" data-slide="next"><i class="fa fa-chevron-right fa-4"></i></a>
</div>
<!--/myCarousel-->
</div>
<!--/well-->
</div>
</div>
$(document).ready(function() {
$('#myCarousel').carousel({
interval: 0
})
$('#myCarousel').on('slid.bs.carousel', function() {
//alert("slid");
});
});
.thumbnail {
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
border-radius: 0;
border: none;
background-color: none;
}
.carousel-control {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 15%;
opacity: .5;
font-size: 20px;
color: #fff;
text-align: center;
text-shadow: none;
}
.carousel-control.left {
background-image: none;
}
.carousel-control.right {
left: auto;
right: 0;
background-image: none;
}
.carousel-control {
padding-top:10.25%;
width:5%;
}
答案 0 :(得分:0)
我原来是the jQuery-UI bootstrap css。我想你在Bootstrap源中有类似的区别。
我会链接一个小提琴,但你已经有了这个代码。