html代碼部分
<div id="myCarousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active"><img src="" /></div>
<div class="item"><img src=""</div>
<div class="item"><img src=""</div>
</div>
<a href="#myCarousel" data-slide="prev" class="carousel-control left">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a href="#myCarousel" data-slide="next" class="carousel-control right">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
css樣式部分
#myCarousel{
margin:50px 0 0 0;
}
Jquery控制代碼部分
//輪播自動(dòng)播放
$('#myCarousel').carousel({
//自動(dòng)4秒播放
interval : 4000,
});