Created
November 6, 2012 08:55
-
-
Save arkadylukashov/4023570 to your computer and use it in GitHub Desktop.
Fade Toggler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.fadeToggle = function(speed, callback, important) { | |
return this.each(function() { | |
$(this)[ important ? ( important == 'show' ? 'fadeIn' : 'fadeOut') : ( $(this).is(':visible') ? 'fadeOut' : 'fadeIn' ) ](speed, callback); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.fadeToggle = function(s,c,i){return this.each(function(){$(this)[i?(i=='show'?'fadeIn':'fadeOut'):($(this).is(':visible')?'fadeOut':'fadeIn')](s,c);});} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment