jQuery Bootstrap垂直手风琴选项卡

所属分类:导航-手风琴菜单

 33772  393  查看评论 (4)
分享到微信朋友圈
X
jQuery Bootstrap垂直手风琴选项卡 ie兼容8

使用方法

在页面中引入bootstrap相关文件。

<link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="path/to/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

HTML结构

该垂直手风琴列表的基本HTML结构如下。

<div class="container">
    <div class="row">
        <div class="col-md-offset-3 col-md-6">
            <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingOne">
                        <h4 class="panel-title">
                            <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                                Section 1
                            </a>
                        </h4>
                    </div>
                    <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                        <div class="panel-body">
                            <p>.... </p>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingTwo">
                        <h4 class="panel-title">
                            <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
                                Section 2
                            </a>
                        </h4>
                    </div>
                    <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
                        <div class="panel-body">
                            <p>...</p>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading" role="tab" id="headingThree">
                        <h4 class="panel-title">
                            <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
                                Section 3
                            </a>
                        </h4>
                    </div>
                    <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
                        <div class="panel-body">
                            <p>.... </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

CSS样式

该垂直手风琴列表的css样式如下:

a:hover,a:focus{
    text-decoration: none;
    outline: none;
}
#accordion{
    padding-right: 24px;
    padding-left: 24px;
    z-index: 1;
}
#accordion .panel{
    border: none;
    box-shadow: none;
}
#accordion .panel-heading{
    padding: 0;
    border-radius: 0;
    border: none;
}
#accordion .panel-title{
    padding: 0;
}
#accordion .panel-title a{
    display: block;
    font-size: 16px;
    font-weight: bold;
    background: #e16b47;
    color: #f7c59f;
    padding: 15px 25px;
    position: relative;
    margin-left: -24px;
    transition: all 0.3s ease 0s;
}
#accordion .panel-title a.collapsed{
    background: #f7c59f;
    color: #e16b47;
    margin-left: 0;
    transition: all 0.3s ease 0s;
}
#accordion .panel-title a:before{
    content: "";
    border-left: 24px solid #e16b47;
    border-top: 24px solid transparent;
    border-bottom: 24px solid transparent;
    position: absolute;
    top: 0;
    right: -24px;
    transition: all 0.3s ease 0s;
}
#accordion .panel-title a.collapsed:before{
    border-left-color: #f7c59f;
}
#accordion .panel-title a:after{
    content: "\f106";
    font-family: 'FontAwesome';
    position: absolute;
    top: 30%;
    right: 15px;
    font-size: 18px;
    color: #f7c59f;
}
#accordion .panel-title a.collapsed:after{
    content: "\f107";
    color: #e16b47;
}
#accordion .panel-collapse{
    position: relative;
}
#accordion .panel-collapse.in:before{
    content: "";
    border-right: 24px solid #f7c59f;
    border-bottom: 18px solid transparent;
    position: absolute;
    top: 0;
    left: -24px;
}
#accordion .panel-body{
    font-size: 14px;
    color: #333;
    background: #e4e4e4;
    border-top: none;
    z-index: 1;
}
相关插件-手风琴菜单

jQuery 手风琴插件accordion.js

可自定义宽高,图片数量,事件的手风琴插件
  手风琴菜单
 40895  416

jquery手风琴折叠式

多级菜单 JS 手风琴
  手风琴菜单
 40996  340

手风琴展开动画效果(感谢上传手风琴效果的朋友)

因项目需要做一个这种风格的插件,正巧jq22上有同类型的插件。在此基础上进行精简及优化,欢迎大家使用。
  手风琴菜单
 30653  400

jQuery手风琴图片轮播切换

jQuery手风琴图片轮播切换
  手风琴菜单
 44173  445

讨论这个项目(4)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

    wuw 0
    2019/6/5 9:55:19
    展开改哪个属性? 回复
    ongaih 0
    2018/8/24 21:17:41
    想始终都让有一个标签是展开状态 应该怎么改啊??? 回复
    SiriBen 0
    2017/11/19 10:44:25

    这个效果挺不错的,而且兼用移动端

    回复
    夜啸苍姬 0
    2017/10/26 14:09:15
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
取消回复