<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 功能強大 支持多語言、二開方便! 廣告
                # .addClass() Categories: [Effects](http://www.css88.com/jquery-ui-api/category/effects/ "View all posts in Effects") | [Effects Core](http://www.css88.com/jquery-ui-api/category/effects-core/ "View all posts in Effects Core") | [Method Overrides](http://www.css88.com/jquery-ui-api/category/overrides/ "View all posts in Method Overrides") ## .addClass( className [, duration ] [, easing ] [, complete ] )Returns: [jQuery](http://api.jquery.com/Types/#jQuery) **描述:** 為每個匹配的元素添加指定的樣式類名,而且所有改變的樣式以動畫的形式展示 * #### [.addClass( className [, duration ] [, easing ] [, complete ] )](#addClass-className-duration-easing-complete) * **className**Type: [String](http://api.jquery.com/Types/#String)為每個匹配元素的class屬性增加一個或多個樣式名(空格隔開)。 * **duration** (default: `400`)Type: [Number](http://api.jquery.com/Types/#Number) or [String](http://api.jquery.com/Types/#String)一個字符串或者數字決定動畫將運行多久。(愚人碼頭注:默認值: "normal", 三種預定速度的字符串("slow", "normal", 或 "fast")或表示動畫時長的毫秒數值(如:1000) ) * **easing** (default: `swing`)Type: [String](http://api.jquery.com/Types/#String)一個字符串,表示過渡使用哪種[緩動](/easings/) 函數。 * **complete**Type: [Function](http://api.jquery.com/Types/#Function)()在動畫完成時執行的函數。 * #### [.addClass( className [, options ] )](#addClass-className-options) * **className**Type: [String](http://api.jquery.com/Types/#String)為每個匹配元素的class屬性增加一個或多個樣式名(空格隔開)。 * **options**Type: [Object](http://api.jquery.com/Types/#Object)一組包含動畫選項的值的集合。 支持的選項: * **duration** (default: `400`)Type: [Number](http://api.jquery.com/Types/#Number) or [String](http://api.jquery.com/Types/#String)一個字符串或者數字決定動畫將運行多久。(譯者注:默認值: "normal", 三種預定速度的字符串("slow", "normal", 或 "fast")或表示動畫時長的毫秒數值(如:1000) ) * **easing** (default: `swing`)Type: [String](http://api.jquery.com/Types/#String)一個字符串,表示過渡使用哪種[緩動](/easings/) 函數。 * **complete**Type: [Function](http://api.jquery.com/Types/#Function)()在動畫完成時執行的函數。 * **children** (default: `false`)Type: [Boolean](http://api.jquery.com/Types/#Boolean)動畫是否應用到所有匹配的元素的后代元素。應慎使用此功能。 因為要確定哪些后代元素要應用動畫可能會非常好性能,而且 后代元素的數量是線性增長的。 * **queue** (default: `true`)Type: [Boolean](http://api.jquery.com/Types/#Boolean) or [String](http://api.jquery.com/Types/#String)一個布爾值,指示是否將動畫放置在效果隊列中。如果為false時,將立即開始動畫。 **從jQuery1.7開始**,隊列選項也可以接受一個字符串,在這種情況下, 在動畫被添加到由該字符串表示的隊列中。 類似原生CSS transitions(過渡), jQuery UI的樣式動畫提供了一個從一個狀態到另一個狀態平滑過渡, 同時讓你 保持那些CSS樣式改版的所有細節,和你的javaScript分離。所有樣式動畫的方法,包括 `.addClass()` 支持自定義的持續時間(durations)和緩沖函數(easing),以及在動畫完成時提供一個回調。 并非所有的樣式都可以設置動畫。 例如,沒有辦法讓背景圖像應用動畫。不能進行動畫的樣式,將在動畫結束時被改變。 這個插件擴展了jQuery中的[`.addClass()`](http://api.jquery.com/addClass)方法。 如果沒有加載 jQuery UI,調用`.addClass()`方法可能不會失敗,因為方法仍然存在。 然而,預期的行為(愚人碼頭注:指平滑過渡動畫效果)將不會發生。 ## Example: #### 匹配的元素上添加"big-blue"樣式。 ``` <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>addClass demo</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"> <style> div { width: 100px; height: 100px; background-color: #ccc; } .big-blue { width: 200px; height: 200px; background-color: #00f; } </style> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> </head> <body> <div></div> <script> $( "div" ).click(function() { $( this ).addClass( "big-blue", 1000, "easeOutBounce" ); }); </script> </body> </html> ```
                  <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>

                              哎呀哎呀视频在线观看