国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

輕松實現Bootstrap圖片輪播

2019-11-20 10:49:04
字體:
來源:轉載
供稿:網友

本文實例講解了Bootstrap實現圖片輪播的詳細代碼,分享給大家供大家參考,具體內容如下

具體代碼:

<!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>

效果

可選參數

  • data-ride=”carousel”:加上可以自動播放,不加點擊后才會播放。
  • 添加標題

標題寫在 <div class="carousel-caption"></div>之間
例如:

<div class="carousel-caption"> <h3>果殼推書正式上線</h3> <p>好書分享、經驗交流</p></div>

如果大家還想深入學習,可以點擊這里進行學習,再為大家附兩個精彩的專題:Bootstrap學習教程 Bootstrap實戰教程

精彩專題分享:jQuery圖片輪播 JavaScript圖片輪播

以上就是針對javascript圖片輪播進行的詳細介紹,希望本文對大家學習javascript程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 七台河市| 蒙阴县| 广州市| 林口县| 元阳县| 额敏县| 长兴县| 安徽省| 和顺县| 扶沟县| 齐齐哈尔市| 大名县| 白朗县| 沙河市| 台北市| 石楼县| 法库县| 揭阳市| 涪陵区| 通城县| 七台河市| 库车县| 枝江市| 遵义县| 江西省| 元氏县| 巴中市| 锦州市| 宁武县| 娄底市| 眉山市| 额尔古纳市| 得荣县| 宣汉县| 临颍县| 上杭县| 金门县| 广元市| 肇州县| 静乐县| 北碚区|