瀏覽代碼

Listing 4.22: manual queueing of non-animate() with queue().

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

+ 4 - 1
Chapter 4/04.js

@@ -43,7 +43,10 @@ $(document).ready(function () {
       .animate({left: paraWidth - switcherWidth}, {duration: 'slow', queue: false})
       .fadeTo('slow', 1.0)
       .slideUp('slow')
-      .css({'background-color': '#f00'})
+      .queue(function (next) {
+        $switcher.css({'background-color': '#f00'});
+        next();
+      })
       .slideDown('slow')
     ;
   });