Detecting div size with jquery
<p>I am trying to use jquery to detect a divs height and use the value to resize a column so it stretches the entire height of the page.</p>

<p>I have been able to do this by grabbing the window height with:</p>

<pre><code>var $pheight = $(window).height();
</code></pre>

<p>but that only works on pages where the content doesn't go beyond the fold.</p>

<p>i have one page where the content spans beyou the fold and am finding that the original script doesn't help for that page. Original script:</p>

<pre><code>var $pheight = $(window).height();
$('#col_left').css('height', $pheight);
});
</code></pre>

<p>I am thinking I need a conditional like this:</p>

<pre><code>var $pheight = $(window).height();
var $contentdiv = $('#content');
var $contentheight = $contentdiv.height();

    if($contentheight &gt; $pheight){
        $('#col_left').css('height', $contentheight);   
    }else{
        $('#col_left').css('height', $pheight);     
    }
</code></pre>

<p>Problem is when I test with an alert:</p>

<pre><code>alert($contentheight);
</code></pre>

<p>I get undefined as a value...</p>

<p>Finally the question</p>

<p>How do I detect the #content height?
The #content just scales with the content within so no css to define the height.</p>

<p>Thanks all for any help with this</p>
