// jQuery plugin // - will adjust a content area to be at least as // tall as the sidebar area // Ex: // $('#content').adjustHeightWithSidebar() // $('#content').adjustHeightWithSidebar({sidebar_selector: '#side-bar'}) (function($) { $.fn.adjustHeightWithSidebar = function(options) { settings = $.extend({ sidebar_selector: '#sidebar' }, options) var content_height = $(this).height(), sidebar_height = $(settings.sidebar_selector).height() return this.each(function() { if (sidebar_height > content_height) $(this).height(sidebar_height) }) } })(jQuery)