bootstrap轮播插件使用方法

Bootstrap Carousel是一款实用的轮播组件,示例如下:

代码如下:


<div id="carousel-example" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
 <li data-target="#carousel-example" data-slide-to="0" class="active"></li>
 <li data-target="#carousel-example" data-slide-to="1"></li>
 <li data-target="#carousel-example" data-slide-to="2"></li>
 </ol><!-- Wrapper for slides -->
 <div class="carousel-inner">
 <div class="item active">
 <img src="http://ww1.sinaimg.cn/large/44287191gw1excbq6tb3rj21400migrz.jpg" alt="..." />
 <div class="carousel-caption">...</div>
 </div>
 <div class="item">
 <img src="http://ww3.sinaimg.cn/large/44287191gw1excbq5iwm6j21400min3o.jpg" alt="..." />
 <div class="carousel-caption">...</div>
 </div>
 <div class="item">
 <img src="http://ww2.sinaimg.cn/large/44287191gw1excbq4kx57j21400migs4.jpg" alt="..." />
 <div class="carousel-caption">...</div>
 </div>
 </div>
 <!-- Controls -->
 <a class="left carousel-control" href="#carousel-example" data-slide="prev">
 <span class="glyphicon glyphicon-chevron-left"></span></a>
 <a class="right carousel-control" href="#carousel-example" data-slide="next">
 <span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
<script>
 $(function(){
 $('.carousel').carousel();
 });
</script>

本文链接:http://bookshadow.com/weblog/2014/05/13/bootstrap-carousel-js/
请尊重作者的劳动成果,转载请注明出处!书影博客保留对文章的所有权利。

如果您喜欢这篇博文,欢迎您捐赠书影博客: ,查看支付宝二维码