<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ## 思想 > 1. 將選擇的li的定位到盒子的固定位置,給ul一個padding-top,避免元素覆蓋 > 2. 選擇后 將ul隱藏 設置超出隱藏 height為0; 被選擇的元素在padding位置,因此不會被隱藏 ## html ``` <div class="credit-class "> <ul class="credit-class-hide"> <li class="choose">物流</li> <li >醫療</li> <li >生活</li> </ul> </div> ``` ## 樣式CSS ``` *{ margin: 0; padding: 0 } .credit-class { width: 60px; background: #fff; text-align: center; position: relative; } .credit-class ul { padding-top: 30px; } .credit-class-hide { height: 0px; overflow: hidden; } .credit-class li { width: 100%; list-style: none; line-height: 30px; } .credit-class ul .choose { background: #3DCD58; color: #fff; position: absolute; top: 0px; display: block; } ``` ## jQuery代碼 ``` $(function () { $(".credit-class ul li").click(function () { console.log(1) $(this).addClass("choose").siblings().removeClass("choose"); $(".credit-class ul").toggleClass("credit-class-hide") }) }) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看