Bootstrap圖片輪播效果詳解
更新時間:2017年10月17日 10:41:14 作者:阿浩yohann
這篇文章主要為大家詳細介紹了Bootstrap圖片輪播效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
導(dǎo)言
Bootstrap 輪播(Carousel)插件是一種靈活的響應(yīng)式的向站點添加滑塊的方式。除此之外,內(nèi)容也是足夠靈活的,可以是圖像、內(nèi)嵌框架、視頻或者其他您想要放置的任何類型的內(nèi)容。
示例
下面演示圖片的輪播,使用bootstrap中的Carousel顯示循環(huán)播放元素插件。
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<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>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="..." alt="...">
<div class="carousel-caption">
...
</div>
</div>
<div class="item">
<img src="..." alt="...">
<div class="carousel-caption">
...
</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>
在src中插入圖片已為圖片設(shè)置大小

還可以為其加上標題
<div class="item"> <img src="..." alt="..."> <div class="carousel-caption"> <h3>...</h3> <p>...</p> </div> </div>

參考
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
通過Javascript將數(shù)據(jù)導(dǎo)出到外部Excel文檔的函數(shù)代碼
通過Javascript將數(shù)據(jù)導(dǎo)出到外部Excel文檔的函數(shù)代碼,需要的朋友可以參考下2012-06-06
JavaScript輸出為[object?Object]問題的解決辦法
平時我們在接收后端返回的json對象通常是一個字符串類型的object,所以一般我們要對這個object進行類型轉(zhuǎn)化后,我們才能使用object里面的數(shù)據(jù),這篇文章主要給大家介紹了關(guān)于JavaScript輸出為[object?Object]問題的解決辦法,需要的朋友可以參考下2023-11-11

