]> source.dussan.org Git - jquery.git/commitdiff
fadeToggle(). as suggested by Karl Swedberg in his jQcon talk. patched live! omg 56/head
authorPaul Irish <paul.irish@gmail.com>
Sun, 17 Oct 2010 18:26:32 +0000 (14:26 -0400)
committerPaul Irish <paul.irish@gmail.com>
Sun, 17 Oct 2010 18:26:32 +0000 (14:26 -0400)
src/effects.js
test/index.html
test/unit/effects.js

index 7d2cd8f93ee6650b4a0240733168b2c41a203abc..d7896c0e02e43c563dfc2fe46cf11056d17f442f 100644 (file)
@@ -252,7 +252,8 @@ jQuery.each({
        slideUp: genFx("hide", 1),
        slideToggle: genFx("toggle", 1),
        fadeIn: { opacity: "show" },
-       fadeOut: { opacity: "hide" }
+       fadeOut: { opacity: "hide" },
+       fadeToggle: { opacity: "toggle" }
 }, function( name, props ) {
        jQuery.fn[ name ] = function( speed, easing, callback ) {
                return this.animate( props, speed, easing, callback );
index 03e1d9758da80ca05c4db8b25c444a56e577ebc4..e6687272511a9347faaff6807cb858e23154ff13 100644 (file)
@@ -259,6 +259,9 @@ Z</textarea>
 
                        <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
                        <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
+                       
+                       <div id="fadetogglein" class='chain test'>fadeToggleIn<div>fadeToggleIn</div></div>
+      <div id="fadetoggleout" class='chain test out'>fadeToggleOut<div>fadeToggleOut</div></div>
 
                        <div id="fadeto" class='chain test'>fadeTo<div>fadeTo</div></div>
                </div>
index 6baa0f62d8025bada17888fa69d98e15e4ab0269..952afc5b1e7848b9d2ec5926595a098291aa857b 100644 (file)
@@ -729,6 +729,13 @@ test("Chain slideToggle out", function() {
        jQuery('#slidetoggleout div').saveState(jQuery.support.shrinkWrapBlocks).slideToggle('fast').slideToggle('fast',jQuery.checkState);
 });
 
+test("Chain fadeToggle in", function() {
+       jQuery('#fadetogglein div').saveState().fadeToggle('fast').fadeToggle('fast',jQuery.checkState);
+});
+test("Chain fadeToggle out", function() {
+       jQuery('#fadetoggleout div').saveState().fadeToggle('fast').fadeToggle('fast',jQuery.checkState);
+});
+
 test("Chain fadeTo 0.5 1.0 with easing and callback)", function() {
        jQuery('#fadeto div').saveState().fadeTo('fast',0.5).fadeTo('fast',1.0,'linear',jQuery.checkState);
 });