Skip to main content
Home / Code Snippets / jQuery Code Snippets / Combine Slide and Fade Functions

Combine Slide and Fade Functions

$.fn.slideFadeToggle  = function(speed, easing, callback) {
        return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
}; 

Usage

$("#something").click(function() {
   $(this).slideFadeToggle();
});
icon-link icon-logo-star icon-search icon-star