Преглед изворни кода

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')
     ;
   });