手风琴

Bootstrap垂直手风琴折叠菜单

阿里云


这是一款 Bootstrap 垂直手风琴折叠菜单。该 Bootstrap 垂直手风琴折叠菜单使用 boostrap 网格进行布局,并通过对 bootstrap 面板组进行美化,构建出精美的垂直手风琴折叠菜单效果。

使用方法:

在页面中引 jquery 和 bootstrap 相关文件。

也想出现在这里?联系我们
创客主机
  1. <link href="path/to/css/bootstrap.min.css" rel="stylesheet">
  2. <link href="path/to/css/font-awesome.min.css" rel="stylesheet">
  3. <script src="path/to/js/jquery.min.js"></script>
  4. <script src="path/to/js/bootstrap.min.js"></script>

HTML 结构:

该 Bootstrap 垂直手风琴折叠菜单的基本 HTML 结构如下:

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-offset-3 col-md-6">
  4.             <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  5.                 <div class="panel panel-default">
  6.                     <div class="panel-heading" role="tab" id="headingOne">
  7.                         <h4 class="panel-title">
  8.                             <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
  9.                                 Section 1
  10.                             </a>
  11.                         </h4>
  12.                     </div>
  13.                     <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
  14.                         <div class="panel-body">
  15.                             <p>菜单内容1 </p>
  16.                         </div>
  17.                     </div>
  18.                 </div>
  19.  
  20.                 <div class="panel panel-default">
  21.                     <div class="panel-heading" role="tab" id="headingTwo">
  22.                         <h4 class="panel-title">
  23.                             <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
  24.                                 Section 2
  25.                             </a>
  26.                         </h4>
  27.                     </div>
  28.                     <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
  29.                         <div class="panel-body">
  30.                             <p>菜单内容2</p>
  31.                         </div>
  32.                     </div>
  33.                 </div>
  34.  
  35.                 <div class="panel panel-default">
  36.                     <div class="panel-heading" role="tab" id="headingThree">
  37.                         <h4 class="panel-title">
  38.                             <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
  39.                                 Section 3
  40.                             </a>
  41.                         </h4>
  42.                     </div>
  43.                     <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
  44.                         <div class="panel-body">
  45.                             <p>菜单内容3</p>
  46.                         </div>
  47.                     </div>
  48.                 </div>
  49.             </div>
  50.         </div>
  51.     </div>
  52. </div>

CSS 样式:

然后通过下面的 CSS 代码来对该 Bootstrap 垂直手风琴折叠菜单进行效果美化。

  1. a:hover,a:focus{
  2.     text-decoration: none;
  3.     outline: none;
  4. }
  5. #accordion .panel{
  6.     border: none;
  7.     box-shadow: none;
  8.     border-radius: 0;
  9.     margin: 0 0 15px 10px;
  10. }
  11. #accordion .panel-heading{
  12.     padding: 0;
  13.     border-radius: 30px;
  14. }
  15. #accordion .panel-title a{
  16.     display: block;
  17.     padding: 12px 20px 12px 50px;
  18.     background: #ebb710;
  19.     font-size: 18px;
  20.     font-weight: 600;
  21.     color: #fff;
  22.     border: 1px solid transparent;
  23.     border-radius: 30px;
  24.     position: relative;
  25.     transition: all 0.3s ease 0s;
  26. }
  27. #accordion .panel-title a.collapsed{
  28.     background: #fff;
  29.     color: #0d345d;
  30.     border: 1px solid #ddd;
  31. }
  32. #accordion .panel-title a:after,
  33. #accordion .panel-title a.collapsed:after{
  34.     content: "\f107";
  35.     font-family: fontawesome;
  36.     width: 55px;
  37.     height: 55px;
  38.     line-height: 55px;
  39.     border-radius: 50%;
  40.     background: #ebb710;
  41.     font-size: 25px;
  42.     color: #fff;
  43.     text-align: center;
  44.     border: 1px solid transparent;
  45.     box-shadow: 0 3px 10px rgba(0, 0, 0, 0.58);
  46.     position: absolute;
  47.     top: -5px;
  48.     left: -20px;
  49.     transition: all 0.3s ease 0s;
  50. }
  51. #accordion .panel-title a.collapsed:after{
  52.     content: "\f105";
  53.     background: #fff;
  54.     color: #0d345d;
  55.     border: 1px solid #ddd;
  56.     box-shadow: none;
  57. }
  58. #accordion .panel-body{
  59.     padding: 20px 25px 10px 9px;
  60.     background: transparent;
  61.     font-size: 14px;
  62.     color: #8c8c8c;
  63.     line-height: 25px;
  64.     border-top: none;
  65.     position: relative;
  66. }
  67. #accordion .panel-body p{
  68.     padding-left: 25px;
  69.     border-left: 1px dashed #8c8c8c;
  70. }

Bootstrap 垂直手风琴折叠菜单

已有 713 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!