JS if inside for loop
<p>I'm trying to rewrite this as a for loop; my attempt below failed. Any ideas?</p>

<pre><code>jQuery.event.add(window, "load", resizeFrame);
jQuery.event.add(window, "resize", resizeFrame);
function resizeFrame()
    if ($(window).width() &lt; 232){
        $("#grid-content").css( 'width', '232px' );
    }else if ($(window).width() &lt; 458){
        $("#grid-content").css( 'width', '232px' );
    }else if ($(window).width() &lt; 684){
        $("#grid-content").css( 'width', '458px' );
    }else if ($(window).width() &lt; 910){
        $("#grid-content").css( 'width', '684px' );
    }else if ($(window).width() &lt; 1136){
        $("#grid-content").css( 'width', '910px' );
    };
};
</code></pre>

<p>The result is the div (#grid-content) is really wide around 3000px, regardless of window size.</p>

<pre><code>jQuery.event.add(window, "load", resizeFrame);
jQuery.event.add(window, "resize", resizeFrame);
function resizeFrame()
    for (var x=232;x&lt;=3000;x=x+226){
        if ($(window).width() &lt; x ){
            $("#grid-content").css( 'width', x +'px' );
        };
    };
};
</code></pre>
