瀏覽代碼

Listing 4.18: queued animate().

Frederic G. MARAND 8 年之前
父節點
當前提交
f9a9490685
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      Chapter 4/04.js

+ 3 - 5
Chapter 4/04.js

@@ -40,10 +40,8 @@ $(document).ready(function () {
     var switcherWidth = $switcher.outerWidth();
     $switcher.css({
       position: 'relative'
-    }).animate({
-      borderWidth: '5px',
-      left: paraWidth - switcherWidth,
-      height: '+=20px'
-    }, 'slow');
+    }).animate({left: paraWidth - switcherWidth}, 'slow')
+      .animate({height: '+=20px'}, 'slow')
+      .animate({borderWidth: '5px'}, 'slow');
   });
 });