bootstrap圖片輪播效果
以下是一個(gè)簡(jiǎn)單的 bootstrap 圖片輪播效果:
<div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <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> <!-- Wrapper for slides --> <div class="carousel-inner"> <div class="item active"> <img src="img/slide1.jpg" alt="Slide 1"> </div> <div class="item"> <img src="img/slide2.jpg" alt="Slide 2"> </div> <div class="item"> <img src="img/slide3.jpg" alt="Slide 3"> </div> </div> <!-- Left and right controls --> <a class="left carousel-control" href="#myCarousel" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#myCarousel" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> <span class="sr-only">Next</span> </a> </div>
此代碼包括輪播容器,指示器,圖片和左右箭頭控制。可以根據(jù)需要進(jìn)行自定義樣式。
[聲明]原創(chuàng)不易,請(qǐng)轉(zhuǎn)發(fā)者備注下文章來(lái)源(hbsjsd.cn)【速建時(shí)代】。