(function($) { $.fn.display = function(show) { if(this.hasClass('inline')) { this.css('visibility', show ? 'visible' : 'hidden'); } else { if(show) this.show(); else this.hide(); } }; })(jQuery);