I'm trying to align the height of a sidebar div by the height of another div, accessed (show/hide) by clicking on a link. The solution I've implemented so far is to attach a function to each click, and set $('').height(height) for the sidebar div. 'Course, it doesn't work in IE7, although it's great in IE8 and firefox.
JS code:
function BindResizeSideBar() {
$('div#containerFloat div#tabs-box a').each ( function() {
var targetId = this.getAttribute('href');
if($('div#' + targetId).length == 0) return;
$(this).bind('click', function() {
var height = $('div#' + targetId).height() + 90;
alert(targetId + ', ' + height);
$('div#divSavedSearchesSideBar div.leftSide').height(height);
});
});
// init: click on tabProfile;
$('div#containerFloat div#tabs-box a[href=#tabProfile]').click();
}
HTML structure:
<div#content-side.searchProspects>
<div#sidebar style="float: left; width: 15%;">
<div#divTabContainer>
<div#header>
<div#containerFloat>
<div#tabs-box>
<div#tabContent1>
<div#tabContent2>
...
<div#tabContent6>