bootstrap手風(fēng)琴折疊示例代碼分享
本文實(shí)例為大家分享了bootstrap手風(fēng)琴的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <title>XXX</title> <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="css/main.css"> <!--[if lt IE 9]> <script src="lib/html5shiv/html5shiv.min.js"></script> <script src="lib/respond/respond.min.js"></script> <![endif]--> </head> <body style="margin: 200px;"> <!--基本實(shí)例--> <button class="btn btn-primary" data-toggle="collapse" data-target="#content"> Bootstrap </button> <div class="collapse" id="content"> <!--<div class="collapse fade in" id="content">--> <div class="well"> Bootstrap 是 Twitter 推出的一個(gè)用于前端開發(fā)的開源工具包。它由 Twitter 的設(shè)計(jì)師 Mark Otto 和 Jacob Thornton 合作開發(fā),是一個(gè) CSS/HTML 框架。目 前,Bootstrap 最新版本為 3.0 。 </div> </div> <br> <br> <br> <!--1、折疊部分設(shè)置一個(gè)id 2、在被點(diǎn)擊的連接處引入<a href="#collapseOne" rel="external nofollow" rel="external nofollow" rel="external nofollow" 3、還是在被點(diǎn)擊的連接處加入 date-toggle="collapse" 4、寫完之后第一次不正常,所以需要在折疊部分寫上 class=“collapse”(表示一開始隱藏)或者 “collapse in”(表示一開始展開) --> <!--<div class="panel-group"><!–大容器–> <div class="panel panel-default"><!–這個(gè)表示第一個(gè)整塊兒的–> <div class="panel-heading"><!–第一部分,被點(diǎn)擊部分–> <h4 class="panel-title"> <a href="#collapseOne" rel="external nofollow" rel="external nofollow" rel="external nofollow" data-toggle="collapse">1號(hào)連接</a> </h4> </div> <div class="panel-collapse collapse" id="collapseOne"><!–第二部分,折疊部分–> <div class="panel-body"> 1號(hào)內(nèi)容 </div> </div> </div> <div class="panel panel-default"><!–這個(gè)表示第一個(gè)整塊兒的–> <div class="panel-heading"><!–第一部分,被點(diǎn)擊部分–> <h4 class="panel-title"> <a href="#collapseTwo" rel="external nofollow" rel="external nofollow" data-toggle="collapse">2號(hào)連接</a> </h4> </div> <div class="panel-collapse collapse" id="collapseTwo"><!–第二部分,折疊部分–> <div class="panel-body"> 2號(hào)內(nèi)容 </div> </div> </div> <div class="panel panel-default"><!–這個(gè)表示第一個(gè)整塊兒的–> <div class="panel-heading"><!–第一部分,被點(diǎn)擊部分–> <h4 class="panel-title"> <a href="#collapseThree" rel="external nofollow" rel="external nofollow" data-toggle="collapse">3號(hào)連接</a> </h4> </div> <div class="panel-collapse collapse" id="collapseThree"><!–第二部分,折疊部分–> <div class="panel-body"> 3號(hào)內(nèi)容 </div> </div> </div> </div>--> <br> <br> <br> <br> <!--點(diǎn)擊某一展開,其他的都自動(dòng)折疊 1、給大容器加一個(gè)id id="accordion" 2、給每一個(gè)被點(diǎn)擊鏈接加上一個(gè) data-parent="#accordion" --> <div class="panel-group" id="accordion"><!--大容器--> <div class="panel panel-default"><!--這個(gè)表示第一個(gè)整塊兒的--> <div class="panel-heading"><!--第一部分,被點(diǎn)擊部分--> <h4 class="panel-title"> <a href="#collapseOne" rel="external nofollow" rel="external nofollow" rel="external nofollow" data-toggle="collapse" data-parent="#accordion">1號(hào)連接</a> </h4> </div> <div class="panel-collapse collapse" id="collapseOne"><!--第二部分,折疊部分--> <div class="panel-body"> 1號(hào)內(nèi)容 </div> </div> </div> <div class="panel panel-default"><!--這個(gè)表示第一個(gè)整塊兒的--> <div class="panel-heading"><!--第一部分,被點(diǎn)擊部分--> <h4 class="panel-title"> <a href="#collapseTwo" rel="external nofollow" rel="external nofollow" data-toggle="collapse" data-parent="#accordion">2號(hào)連接</a> </h4> </div> <div class="panel-collapse collapse" id="collapseTwo"><!--第二部分,折疊部分--> <div class="panel-body"> 2號(hào)內(nèi)容 </div> </div> </div> <div class="panel panel-default"><!--這個(gè)表示第一個(gè)整塊兒的--> <div class="panel-heading"><!--第一部分,被點(diǎn)擊部分--> <h4 class="panel-title"> <a href="#collapseThree" rel="external nofollow" rel="external nofollow" data-toggle="collapse" data-parent="#accordion">3號(hào)連接</a> </h4> </div> <div class="panel-collapse collapse" id="collapseThree"><!--第二部分,折疊部分--> <div class="panel-body"> 3號(hào)內(nèi)容 </div> </div> </div> </div> <script src="lib/jquery/jquery.js"></script> <script src="lib/bootstrap/js/bootstrap.js"></script> <script src="js/main.js"></script> </body> </html>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- Bootstrap 手風(fēng)琴菜單的實(shí)現(xiàn)代碼
- bootstrap手風(fēng)琴制作方法詳解
- 簡(jiǎn)潔實(shí)用的BootStrap jQuery手風(fēng)琴插件
- Angular.js與Bootstrap相結(jié)合實(shí)現(xiàn)手風(fēng)琴菜單代碼
- 全面解析Bootstrap手風(fēng)琴效果
- bootstrap折疊調(diào)用collapse()后data-parent不生效的快速解決辦法
- Bootstrap基本插件學(xué)習(xí)筆記之折疊(22)
- Bootstrap每天必學(xué)之折疊(Collapse)插件
- Bootstrap每天必學(xué)之折疊
- Bootstrap創(chuàng)建可折疊的組件
相關(guān)文章
JS實(shí)現(xiàn)簡(jiǎn)單tab選項(xiàng)卡切換
這篇文章主要為大家詳細(xì)介紹了JS實(shí)現(xiàn)簡(jiǎn)單tab選項(xiàng)卡切換,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-10-10js在客戶端驗(yàn)證密碼強(qiáng)度,兼容FireFox和IE
js在客戶端驗(yàn)證密碼強(qiáng)度,兼容FireFox和IE...2007-05-05微信小程序?qū)崿F(xiàn)點(diǎn)擊導(dǎo)航標(biāo)簽滾動(dòng)定位到對(duì)應(yīng)位置
這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)點(diǎn)擊導(dǎo)航標(biāo)簽滾動(dòng)定位到對(duì)應(yīng)位置,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-11-11javascript實(shí)現(xiàn)捕捉鍵盤上按下的鍵
JavaScript取得按下鍵盤的鍵是哪個(gè),通過(guò)創(chuàng)建一個(gè)event.keyCode對(duì)象,可有效獲取鍵盤上的鍵,運(yùn)行代碼后,點(diǎn)擊鍵盤上的任意鍵,網(wǎng)頁(yè)上顯示你按下的是哪個(gè)鍵。2015-05-05移動(dòng)端使用localStorage緩存Js和css文的方法(web開發(fā))
這篇文章主要介紹了web移動(dòng)端使用localStorage緩存Js和css文的方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-09-09javascript中不易分清的slice,splice和split三個(gè)函數(shù)
這篇文章主要為大家詳細(xì)介紹了javascript中不易分清的slice,splice和split三個(gè)函數(shù),感興趣的小伙伴們可以參考一下2016-03-03