Browse Source

Listing 1.19: more queues effects on a single set of elements.

Frederic G. MARAND 9 years ago
parent
commit
ca238d47f8
1 changed files with 7 additions and 5 deletions
  1. 7 5
      Chapter 4/04.js

+ 7 - 5
Chapter 4/04.js

@@ -38,10 +38,12 @@ $(document).ready(function () {
     var paraWidth = $('div.speech p').outerWidth();
     var $switcher = $(this).parent();
     var switcherWidth = $switcher.outerWidth();
-    $switcher.css({
-      position: 'relative'
-    }).animate({left: paraWidth - switcherWidth}, 'slow')
-      .animate({height: '+=20px'}, 'slow')
-      .animate({borderWidth: '5px'}, 'slow');
+    $switcher.css({ position: 'relative' })
+      .fadeTo('fast', 0.2)
+      .animate({left: paraWidth - switcherWidth}, 'slow')
+      .fadeTo('slow', 1.0)
+      .slideUp('slow')
+      .slideDown('slow')
+    ;
   });
 });