前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >jquery 手风琴效果

jquery 手风琴效果

作者头像
用户5760343
发布2019-08-23 17:47:29
2.9K0
发布2019-08-23 17:47:29
举报
文章被收录于专栏:sktj

image.png

<!doctype html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Bootstrap3扁平风格垂直手风琴特效</title> <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700' rel='stylesheet' type='text/css'> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css"> <link rel="stylesheet" href="css/style.css"> </head> <body>

代码语言:javascript
复制
<section class="jq22-container">
    <div class="container">
      <div class="col-md-6 col-sm-6">
        <h3>Default collapse with scaling icon</h3>
        <div class="panel-group wrap" id="bs-collapse">

          <div class="panel">
            <div class="panel-heading">
              <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#" href="#one">
              Collapse item #1
            </a>
          </h4>
            </div>
            <div id="one" class="panel-collapse collapse">
              <div class="panel-body">
                Where now are the horse and the rider? Where is the horn that was blowing? Where is the helm and the hauberk, and the bright hair flowing?
              </div>
            </div>

          </div>
          <!-- end of panel -->

          <div class="panel">
            <div class="panel-heading">
              <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#" href="#two">
             Collapse item #2
            </a>
          </h4>
            </div>
            <div id="two" class="panel-collapse collapse">
              <div class="panel-body">
                Where is the harp on the harpstring, and the red fire glowing? Where is the spring and the harvest and the tall corn growing?
              </div>

            </div>
          </div>
          <!-- end of panel -->

          <div class="panel">
            <div class="panel-heading">
              <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#" href="#three">
              Collapse item #3
            </a>
          </h4>
            </div>
            <div id="three" class="panel-collapse collapse">
              <div class="panel-body">
                The days have gone down in the West behind the hills into shadow. Who shall gather the smoke of the deadwood burning, Or behold the flowing years from the Sea returning?
              </div>
            </div>
          </div>
          <!-- end of panel -->

          <div class="panel">
            <div class="panel-heading">
              <h4 class="panel-title">
            <a data-toggle="collapse" data-parent="#" href="#four">
             Collapse item #4
            </a>
          </h4>
            </div>
            <div id="four" class="panel-collapse collapse in">
              <div class="panel-body">
                They have passed like rain on the mountain, like a wind in the meadow; The days have gone down in the West behind the hills into shadow.
              </div>
            </div>
          </div>
          <!-- end of panel -->

        </div>
        <!-- end of #bs-collapse  -->

      </div>

      <div class="col-md-6 col-sm-6">
        <h3>Accordion collapse with rotating icon</h3>
        <div class="panel-group wrap" id="accordion" role="tablist" aria-multiselectable="true">
          <div class="panel">
            <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">
              Collapsible item #1
            </a>
          </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
              <div class="panel-body">
                Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch.
              </div>
            </div>
          </div>
          <!-- end of panel -->

          <div class="panel">
            <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">
              Collapsible item #2
            </a>
          </h4>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
              <div class="panel-body">
                Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch.
              </div>
            </div>
          </div>
          <!-- end of panel -->

          <div class="panel">
            <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">
              Collapsible item #3
            </a>
          </h4>
            </div>
            <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
              <div class="panel-body">
                Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch.
              </div>
            </div>
          </div>
          <!-- end of panel -->

          <div class="panel">
            <div class="panel-heading" role="tab" id="headingFour">
              <h4 class="panel-title">
            <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
              Collapsible item #4
            </a>
          </h4>
            </div>
            <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
              <div class="panel-body">
                Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch.
              </div>
            </div>
          </div>
          <!-- end of panel -->

        </div>
        <!-- end of #accordion -->

      </div>
      <!-- end of wrap -->

    </div>
    <!-- end of container -->
</section>


<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
      $('.collapse.in').prev('.panel-heading').addClass('active');
      $('#accordion, #bs-collapse')
        .on('show.bs.collapse', function(a) {
          $(a.target).prev('.panel-heading').addClass('active');
        })
        .on('hide.bs.collapse', function(a) {
          $(a.target).prev('.panel-heading').removeClass('active');
        });
    });
</script>

</body> </html>

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019.08.23 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档