标签:
Bootstrap幻灯片的制作利用到了Carousel插件,包含:左右箭头、图片、点点导航
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Indicators 小点点导航 从0开始--> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> </ol> <!-- Wrapper for slides 轮播组件内容 --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="images/chrome-big.jpg" alt="图片1"> <div class="carousel-caption"> 图片1描述-可选 </div> </div> <div class="item"> <img src="images/firefox-big.jpg" alt="图片2"> <div class="carousel-caption"> 图片2描述-可选 </div> </div> </div> <!-- Controls 左右切换按钮--> <a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div>
补充样式:
<style> /*限制幻灯片高度*/ .carousel{height: 500px;} .carousel .item{height: 500px;} /*图片可跟随窗口缩放*/ .carousel img{width: 100%;} </style>
详情:http://v3.bootcss.com/javascript/#carousel
标签:
原文地址:http://www.cnblogs.com/tinyphp/p/4803453.html