Forráskód Böngészése

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

Frederic G. MARAND 8 éve
szülő
commit
ca238d47f8
1 módosított fájl, 7 hozzáadás és 5 törlés
  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')
+    ;
   });
 });