Skip to content
Permalink
Browse files

fadeToggle(). as suggested by Karl Swedberg in his jQcon talk. patche…

…d live! omg
  • Loading branch information...
paulirish committed Oct 17, 2010
1 parent 8a5df39 commit 97dfa0d5a85a32fe56aba837bbf2bc889b092d2b
Showing with 12 additions and 1 deletion.
  1. +2 −1 src/effects.js
  2. +3 −0 test/index.html
  3. +7 −0 test/unit/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 );
@@ -259,6 +259,9 @@ <h2 id="qunit-userAgent"></h2>

<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>

This comment has been minimized.

Copy link
@jitter

jitter Oct 17, 2010

Contributor

A change to the test-suite which isn't side-effect free. This now breaks the attribute unit-tests addClass(Function) with incoming value and removeClass(Function) with incoming value which depend on the number of divs present in test/index.html so the expect() statements need to be incremented from 41 to 45 on both tests

This comment has been minimized.

Copy link
@paulirish

paulirish Oct 18, 2010

Author Member

jitter, thanks for spotting. I was doing it quickly and a bit sloppily. :)
you want to file a pull req? I know it's minor but since you spotted it you could get the authorship cred on the fix.

This comment has been minimized.

Copy link
@jitter

<div id="fadeto" class='chain test'>fadeTo<div>fadeTo</div></div>
</div>
@@ -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);
});

0 comments on commit 97dfa0d

Please sign in to comment.
You can’t perform that action at this time.