bootstrap實現(xiàn)圖片自動輪播
bootstrap圖片自動輪播效果圖:
代碼實現(xiàn):
<!DOCTYPE html> <html lang="zh-CN"> <head> <link rel="stylesheet" href="bootstrap.min.css" /> <link rel="stylesheet" href="bootstrap-theme.min.css" /> <script src="jquery.min.js"></script> <script src="bootstrap.min.js"></script> <style> #div1 {width:600px; height:500px} </style> </head> <body> <div id="div1"> <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="airplane1.jpg" > </div> <div class="item"> <img src="airplane2.jpg" > </div> <div class="item"> <img src="airplane3.jpg" > </div> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" id="aaron1"></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" id="aaron2"></span> <span class="sr-only">Next</span> </a> </div> </div> </body> <html>
精彩專題分享:jQuery圖片輪播 JavaScript圖片輪播
如果大家還想深入學(xué)習(xí),可以點擊這里進行學(xué)習(xí),再為大家附3個精彩的專題:
以上代碼可以實現(xiàn) div1 中的圖片自動輪播,輪播時間默認5000ms。
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
javascript中href和replace的比較(詳解)
下面小編就為大家?guī)硪黄猨avascript中href和replace的比較(詳解)。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-11-11JavaScript中關(guān)于數(shù)組的調(diào)用方式
這篇文章主要介紹了JavaScript中關(guān)于數(shù)組的調(diào)用方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-02-02微信小程序?qū)崿F(xiàn)發(fā)送短信驗證碼倒計時
這篇文章主要為大家詳細介紹了微信小程序?qū)崿F(xiàn)發(fā)送短信驗證碼倒計時,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-08-08微信小程序報錯: thirdScriptError的錯誤問題
這篇文章主要介紹了微信小程序報錯: thirdScriptError,本文給大家分享解決方法,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-06-06webpack4 從零學(xué)習(xí)常用配置(小結(jié))
這篇文章主要介紹了webpack4 從零學(xué)習(xí)常用配置(小結(jié)),詳細的介紹了幾個核心部分,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-05-05