<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 功能強大 支持多語言、二開方便! 廣告
                ### 返回值:jQuerytoggleClass(class|fn[,sw]) ### 概述 如果存在(不存在)就刪除(添加)一個類。 ### 參數 #### **class**String*V1.0* CSS類名 #### **class,switch**String,Boolean*V1.3* 1:要切換的CSS類名. 2:用于決定元素是否包含class的布爾值。 #### **switch**Boolean*V1.4* 用于決定元素是否包含class的布爾值。 #### **function(index, class,switch)[, switch] **Function,Boolean*V1.4* 1:用來返回在匹配的元素集合中的每個元素上用來切換的樣式類名的一個函數。接收元素的索引位置和元素舊的樣式類作為參數。 2: 一個用來判斷樣式類添加還是移除的 boolean 值。 ### 示例 #### 參數class 描述: 為匹配的元素切換 'selected' 類 ##### jQuery 代碼: ~~~ $("p").toggleClass("selected"); ~~~ #### 參數class,switch 描述: 每點擊三下加上一次 'highlight' 類 ##### HTML 代碼: ~~~ <strong>jQuery 代碼:</strong> ~~~ ##### jQuery 代碼: ~~~ var count = 0; $("p").click(function(){ $(this).toggleClass("highlight", count++ % 3 == 0); }); ~~~ #### 回調函數 描述: 根據父元素來設置class屬性 ##### jQuery 代碼: ~~~ $('div.foo').toggleClass(function() { if ($(this).parent().is('.bar') { return 'happy'; } else { return 'sad'; } }); ~~~
                  <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>

                              哎呀哎呀视频在线观看