jQuery find out element width even when browser window changes size
<p>I have the following jQuery code that finds out the width of container and then tells a child element to be a certain size (minus the size of the sidebar) so that it will fill the screen.</p>

<p>It works fine EXCEPT when the user changes the browser window it doesn't update! So I need the jQuery code to work in realtime. Can anyone help? Thanks</p>

<pre><code>$(document).ready(function () {

    // find out the width of the page
    var pageWidth = $('div.MainContentHolder').width();
    // minus the sidebar and margin width
    var middleWidth = pageWidth - '220';
    // apply the new width to the middle column
    $('div.MiddleColumn').css('width', middleWidth);

});
</code></pre>
