Skip to content

Instantly share code, notes, and snippets.

@jimjeffers
Created February 26, 2009 21:30
Show Gist options
  • Save jimjeffers/71127 to your computer and use it in GitHub Desktop.
Save jimjeffers/71127 to your computer and use it in GitHub Desktop.
Give any div a class 'column' and if it's absolutely positioned this jQuery script will fix the height of the container for you.
// Fix any absolutely positioned columns if necessary.
$(document).ready( function(){
$('.column').each(function(){
var cur = $(this);
if(cur.css('position') == 'absolute') {
var parent = $(cur.parent().get(0));
if(cur.height() > parent.height()) {
parent.css('height',cur.height());
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment