Skip to content

Instantly share code, notes, and snippets.

@acodesmith
Created August 20, 2014 13:41
Show Gist options
  • Save acodesmith/d8eba86ef36a9cddd2a2 to your computer and use it in GitHub Desktop.
Save acodesmith/d8eba86ef36a9cddd2a2 to your computer and use it in GitHub Desktop.
Extend jQuery .show() function to play nice with Twitter Bootstrap hidden class.
/**
* 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