Created
May 7, 2009 00:54
-
-
Save Oshuma/107852 to your computer and use it in GitHub Desktop.
Simple jQuery effect toggles.
This file contains hidden or 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
| // Simple jQuery effect toggles. | |
| // Use just like the jQuery.toggle() method. | |
| // | |
| // $('#some-link').click(function() { | |
| // $('#some-div').slideToggle(); | |
| // }); | |
| jQuery.fn.fadeToggle = function() { | |
| if (this.css('display') == 'none') this.fadeIn(); | |
| else this.fadeOut(); | |
| } | |
| jQuery.fn.slideToggle = function() { | |
| if (this.css('display') == 'none') this.slideDown(); | |
| else this.slideUp(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment