Sum the Heights of Two Elements

This takes the code here a bit further.  Rather than just setting the min-width of #contentinner equal to the height of #sidebar, we’re setting it equal to #sidebar + #footer-widgets.  The magic happens on line 5.

var $contentinner = $('#contentinner');
var footerwidgets = $('#footer-widgets').height();
var sidebarheight = $("#sidebar").height();
    var $adjust = sidebarheight + footerwidgets + 20;
            'min-height' : $adjust + 'px'


Dave Winter focuses in WordPress UI Design and WordPress Plugin Development (some have labelled him a fanatic) but has hands in many other projects, including photography and music. He's never far from a computer... or an iPad (for testing purposes, of course). If you've been to a WordCamp in Southern California, he probably already knows who you are (or maybe not - he's terrible with names). Dave currently teaches courses at California State University, Long Beach alongside his small business at (and his students think he's pretty boss).
© 2008-2020,