Last active
November 5, 2015 07:45
-
-
Save jawdatls/84c0ac6a28618a1eb6e6 to your computer and use it in GitHub Desktop.
jQuery hide function with trigger hide event
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
$('#priceContainer').on('hide',function(){ | |
$('#price').val("0.0"); | |
}); | |
$('#priceContainer').hideWithEvent(); |
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
// 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