Created
August 20, 2014 13:41
-
-
Save acodesmith/d8eba86ef36a9cddd2a2 to your computer and use it in GitHub Desktop.
Extend jQuery .show() function to play nice with Twitter Bootstrap hidden class.
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
/** | |
* Twitter Bootstrap .hidden class can cause unexpected results | |
* when interacting with the jQuery .show() function. | |
* | |
* Extend the native jQuery show functionality to remove | |
* the hidden class when .show() is called. | |
**/ | |
(function($) | |
{ | |
var oldshow = $.fn.show; | |
$.fn.show = function() | |
{ | |
var ret = oldshow.apply(this, arguments); | |
$(this).removeClass('hidden'); | |
return ret; | |
}; | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment