From: Paul Irish Date: Sun, 17 Oct 2010 18:26:32 +0000 (-0400) Subject: fadeToggle(). as suggested by Karl Swedberg in his jQcon talk. patched live! omg X-Git-Tag: 1.4.4rc1~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=97dfa0d5a85a32fe56aba837bbf2bc889b092d2b;p=jquery.git fadeToggle(). as suggested by Karl Swedberg in his jQcon talk. patched live! omg --- diff --git a/src/effects.js b/src/effects.js index 7d2cd8f93..d7896c0e0 100644 --- a/src/effects.js +++ b/src/effects.js @@ -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 ); diff --git a/test/index.html b/test/index.html index 03e1d9758..e66872725 100644 --- a/test/index.html +++ b/test/index.html @@ -259,6 +259,9 @@ Z
slideToggleIn
slideToggleIn
slideToggleOut
slideToggleOut
+ +
fadeToggleIn
fadeToggleIn
+
fadeToggleOut
fadeToggleOut
fadeTo
fadeTo
diff --git a/test/unit/effects.js b/test/unit/effects.js index 6baa0f62d..952afc5b1 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -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); });