jQuery container Div height not expanding
<p>I have used jQuery code to expand the height of Divs within a container. <strong><a href="http://jsfiddle.net/dankellaway/XXxNe/7/" rel="nofollow">Here is the JSFiddle link</a>.</strong></p>

<p>However when resizing the browser width the Divs height is fixed and the text overflows the container. Can the following code be changed to expand the container height and Divs within it so that the text stays within?</p>

<hr>

<p><strong>jQuery code:</strong></p>

<pre><code>$(window).load(function () {
$(window).resize(function () {

    $(document).ready(function () {
        var heightArray = $(".container&gt;div").map(function () {
            return $(this).height();
        }).get();
        var maxHeight = Math.max.apply(Math, heightArray);
        $(".container&gt;div").height(maxHeight);
        $(".container&gt;div").height(maxHeight);
    });

}).trigger('resize');
});
</code></pre>

<p><strong>Style:</strong></p>

<pre><code>.container {
height: auto;
float:left; }

#half {
width:48%;
margin:0.5%;
padding:0.5%;
float:left;
background-color:#1589FF; }
</code></pre>

<p><strong>HTML:</strong></p>

<pre><code>&lt;div class="container"&gt;
&lt;div id="half"&gt;
     &lt;h1&gt;About&lt;/h1&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec. Curabitur posuere enim eget turpis feugiat tempor. Etiam ullamcorper lorem dapibus velit suscipit ultrices. Proin in est sed erat facilisis pharetra.&lt;/div&gt;

&lt;div id="half"&gt;
     &lt;h1&gt;News&lt;/h1&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in.   
&lt;/div&gt;
&lt;/div&gt;
</code></pre>
