Instantly share code, notes, and snippets.
don12pt5
/ sidebar.js
Created
February 26, 2013 09:39
— forked from billerickson/sidebar.js
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
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
/ sidebar.js
Created
December 12, 2012 18:02
Make sidebar as tall as content (might need to tweak the numbers based on your padding)
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
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 ); | |
}; | |
}); |