Skip to content

Instantly share code, notes, and snippets.

@jawdatls
Last active November 5, 2015 07:45
Show Gist options
  • Save jawdatls/84c0ac6a28618a1eb6e6 to your computer and use it in GitHub Desktop.
Save jawdatls/84c0ac6a28618a1eb6e6 to your computer and use it in GitHub Desktop.
jQuery hide function with trigger hide event
$('#priceContainer').on('hide',function(){
$('#price').val("0.0");
});
$('#priceContainer').hideWithEvent();
// define hide function with event
$.fn.hideWithEvent = function(speed, callback) {
var obj = $.fn.hide.apply(this,arguments);
if( obj.is(':hidden') ){
$(this).trigger('hide');
}
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment