Last active
August 29, 2015 14:27
-
-
Save tylershuster/e48f040a3c6d42cf15e1 to your computer and use it in GitHub Desktop.
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
jQuery.fn.extend({ | |
cvToggle: function( duration , easing ) { | |
easing = typeof easing !== 'undefined' ? easing : 'swing'; | |
if( this.css('opacity') == '0' ) { | |
this.slideToggle({ | |
duration: 'fast', | |
easing: easing, | |
complete: function(){ | |
jQuery(this).animate({ | |
opacity: 1 | |
}, duration); | |
} | |
}); | |
} else { | |
this.animate({ | |
opacity: 0, | |
}, duration, function(){ | |
jQuery(this).slideToggle({ duration: 'fast', easing: easing }); | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment