Much closer!
I assumed that just getting all the divs in my #content div would
still yield an array, so I ended up with this:
var columns = $('#content div').get().sort(function(a, b) {return $
(b).height() - $(a).height();});
var highest = columns[0];
$(highest).css({position: "relative"});
If all columns are fixed width or all percentages it works fine. So,
now all that's missing is executing this again on resize. Take the
following scenario:
Three columns, a narrow column with a fixed width, and a wider column
with a percentage width. If the sidebar starts off as the tallest, it
is set to relative, and the footer stays below it. But as the window
gets narrower, so does the main column, and at one point, it becomes
taller than the sidebar. Without triggering again on resize, then the
sidebar is still the relative column.
I just had a thought - my method of setting the position:relative
directly with jQuery isn't very conducive to removing that attribute
once we do get it to trigger on resize. toggleClass won't quite do
what I'm after, will it?
On Jan 30, 2007, at 3:56 AM, Klaus Hartl wrote:
> var columns = $('#column-1, #column-2,
> #column-3').get().sort(function(a, b) {
> return $(b).height() - $(a).height();
> });
> var highest = columns[0];
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/