輕松實(shí)現(xiàn)Bootstrap圖片輪播
本文實(shí)例講解了Bootstrap實(shí)現(xiàn)圖片輪播的詳細(xì)代碼,分享給大家供大家參考,具體內(nèi)容如下
具體代碼:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet"> <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <style type="text/css"> img{ margin:0 auto; } </style> </head> <body> <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="images/lunbo1.jpg" height="266" width="800" alt="..."> <div class="carousel-caption"> ... </div> </div> <div class="item"> <img src="images/lunbo2.jpg" height="266" width="800" alt="..."> <div class="carousel-caption"> ... </div> </div> <div class="item"> <img src="images/lunbo3.jpg" height="266" width="800" 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> </body> </html>
效果
可選參數(shù)
- data-ride=”carousel”:加上可以自動(dòng)播放,不加點(diǎn)擊后才會(huì)播放。
- 添加標(biāo)題
標(biāo)題寫(xiě)在 <div class="carousel-caption"></div>之間
例如:
<div class="carousel-caption"> <h3>果殼推書(shū)正式上線</h3> <p>好書(shū)分享、經(jīng)驗(yàn)交流</p> </div>
如果大家還想深入學(xué)習(xí),可以點(diǎn)擊這里進(jìn)行學(xué)習(xí),再為大家附兩個(gè)精彩的專(zhuān)題:Bootstrap學(xué)習(xí)教程 Bootstrap實(shí)戰(zhàn)教程
精彩專(zhuān)題分享:jQuery圖片輪播 JavaScript圖片輪播
以上就是針對(duì)javascript圖片輪播進(jìn)行的詳細(xì)介紹,希望本文對(duì)大家學(xué)習(xí)javascript程序設(shè)計(jì)有所幫助。
相關(guān)文章
js在客戶(hù)端驗(yàn)證密碼強(qiáng)度,兼容FireFox和IE
js在客戶(hù)端驗(yàn)證密碼強(qiáng)度,兼容FireFox和IE...2007-05-05javascript Xml增刪改查(IE下)操作實(shí)現(xiàn)代碼
比較不錯(cuò)的實(shí)現(xiàn)代碼,大家可以仔細(xì)的看下,思路。2009-01-01JS頁(yè)面刷新與重新加載功能實(shí)現(xiàn)(關(guān)閉當(dāng)前窗口)
在計(jì)算機(jī)網(wǎng)頁(yè)中如果我們想獲取當(dāng)前頁(yè)面最新的內(nèi)容,可以刷新當(dāng)前頁(yè)面重新獲取數(shù)據(jù),這篇文章主要給大家介紹了關(guān)于JS頁(yè)面刷新與重新加載功能實(shí)現(xiàn)(關(guān)閉當(dāng)前窗口)的相關(guān)資料,需要的朋友可以參考下2023-10-10使用JavaScript檢測(cè)Firefox瀏覽器是否啟用了Firebug的代碼
在啟用Firebug的情況下訪問(wèn)GMail會(huì)收到一個(gè) Firebug會(huì)讓Gmail變慢 的警告,這是如何檢測(cè)的呢?這里就說(shuō)說(shuō)。2010-12-12微信小程序項(xiàng)目總結(jié)之點(diǎn)贊 刪除列表 分享功能
這篇文章主要介紹了微信小程序項(xiàng)目總結(jié)之點(diǎn)贊 刪除列表 分享功能,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-06-06