Skip to content

Instantly share code, notes, and snippets.

jQuery(document).ready(function($){
var sidebarHeight = $("#sidebar").height() - 50;
var bodyHeight = $("#content-sidebar-wrap").height();
if (bodyHeight > sidebarHeight) {
$("#sidebar").css( 'min-height', bodyHeight + 50 );
$("#content-sidebar-wrap").css( 'min-height', bodyHeight + 50 );
};
});
@billerickson
billerickson / sidebar.js
Created December 12, 2012 18:02
Make sidebar as tall as content (might need to tweak the numbers based on your padding)
jQuery(document).ready(function($){
var sidebarHeight = $("#sidebar").height() - 50;
var bodyHeight = $("#content-sidebar-wrap").height();
if (bodyHeight > sidebarHeight) {
$("#sidebar").css( 'min-height', bodyHeight + 50 );
$("#content-sidebar-wrap").css( 'min-height', bodyHeight + 50 );
};
});