Explorar o código

Listing 4.25: $(this) changes element in animation callbacks.

Frederic G. MARAND %!s(int64=8) %!d(string=hai) anos
pai
achega
2ae9f6fbd8
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Chapter 4/04.js

+ 3 - 1
Chapter 4/04.js

@@ -52,7 +52,9 @@ $(document).ready(function () {
   });
 
   $('p').eq(2).css('border', '1px solid #333').click(function () {
-    $(this).slideUp('slow').next().slideDown('slow');
+    $(this).next().slideDown('slow', function () {
+        $(this).slideUp('slow');
+    });
   });
   $('p').eq(3).css('background-color', '#ccc').hide();
 });