手风琴

Bootstrap垂直手风琴折叠菜单特效

阿里云


这是一款效果非常炫酷的 Bootstrap 垂直手风琴折叠菜单特效。在该 bootstrap 垂直手风琴折叠菜单中,每个菜单项通过 css3 阴影制作出带立体感觉的纸张效果,非常炫酷。

使用方法:

在页面中引入 jquery 和 bootstrap 相关文件,以及 fontawsome 字体图标文件。。

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

HTML 结构:

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

  1. <div class="container">
  2.     <div class="row">
  3.         <div class="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.                                 <i class="icon fa fa-globe"></i>
  10.                                 Section 1
  11.                             </a>
  12.                         </h4>
  13.                     </div>
  14.                     <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
  15.                         <div class="panel-body">
  16.                             <p>Lorem ipsum dolor sit amet...</p>
  17.                         </div>
  18.                     </div>
  19.                 </div>
  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.                                 <i class="icon fa fa-briefcase"></i>
  25.                                 Section 2
  26.                             </a>
  27.                         </h4>
  28.                     </div>
  29.                     <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
  30.                         <div class="panel-body">
  31.                             <p>Lorem ipsum dolor sit amet...</p>
  32.                         </div>
  33.                     </div>
  34.                 </div>
  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.                                 <i class="icon fa fa-mobile"></i>
  40.                                 Section 3
  41.                             </a>
  42.                         </h4>
  43.                     </div>
  44.                     <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
  45.                         <div class="panel-body">
  46.                             <p>Lorem ipsum dolor sit amet...</p>
  47.                         </div>
  48.                     </div>
  49.                 </div>
  50.             </div>
  51.         </div>
  52.     </div>

CSS 样式:

然后为该 Bootstrap 垂直手风琴折叠菜单添加下面的 CSS 样式,对其进行美化。

  1. a:hover,a:focus{
  2.     text-decoration: none;
  3.     outline: none;
  4. }
  5. #accordion .panel{
  6.     border: none;
  7.     border-radius: 0;
  8.     box-shadow: none;
  9.     margin: 0 0 10px;
  10.     overflow: hidden;
  11.     position: relative;
  12. }
  13. #accordion .panel-heading{
  14.     padding: 0;
  15.     border: none;
  16.     border-radius: 0;
  17.     margin-bottom: 10px;
  18.     z-index: 1;
  19.     position: relative;
  20. }
  21. #accordion .panel-heading:before,
  22. #accordion .panel-heading:after{
  23.     content: "";
  24.     width: 50%;
  25.     height: 20%;
  26.     box-shadow: 0 15px 5px rgba(0, 0, 0, 0.4);
  27.     position: absolute;
  28.     bottom: 15px;
  29.     left: 10px;
  30.     transform: rotate(-3deg);
  31.     z-index: -1;
  32. }
  33. #accordion .panel-heading:after{
  34.     left: auto;
  35.     right: 10px;
  36.     transform: rotate(3deg);
  37. }
  38. #accordion .panel-title a{
  39.     display: block;
  40.     padding: 15px 70px 15px 70px;
  41.     margin: 0;
  42.     background: #fff;
  43.     font-size: 18px;
  44.     font-weight: 700;
  45.     letter-spacing: 1px;
  46.     color: #d11149;
  47.     border-radius: 0;
  48.     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 40px rgba(0, 0, 0, 0.1) inset;
  49.     position: relative;
  50. }
  51. #accordion .panel-title a:before,
  52. #accordion .panel-title a.collapsed:before{
  53.     content: "\f106";
  54.     font-family: fontawesome;
  55.     width: 55px;
  56.     height: 100%;
  57.     text-align: center;
  58.     line-height: 50px;
  59.     border-left: 2px solid #D11149;
  60.     position: absolute;
  61.     top: 0;
  62.     right: 0;
  63. }
  64. #accordion .panel-title a.collapsed:before{ content: "\f107"; }
  65. #accordion .panel-title a .icon{
  66.     display: inline-block;
  67.     width: 55px;
  68.     height: 100%;
  69.     border-right: 2px solid #d11149;
  70.     font-size: 20px;
  71.     color: rgba(0,0,0,0.7);
  72.     line-height: 50px;
  73.     text-align: center;
  74.     position: absolute;
  75.     top: 0;
  76.     left: 0;
  77. }
  78. #accordion .panel-body{
  79.     padding: 10px 20px;
  80.     margin: 0 0 20px;
  81.     border-bottom: 3px solid #d11149;
  82.     border-top: none;
  83.     background: #fff;
  84.     font-size: 15px;
  85.     color: #333;
  86.     line-height: 27px;
  87. }

Bootstrap 垂直手风琴折叠菜单特效

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

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

发表回复

热销模板

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

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