new values on $(window).resize
<p>I first do this and it works:</p>

<pre><code>  $(document).ready(function() {
    var delay = 0;
    var myLeft = $("#container").offset().left;
    var myRight = myLeft + $("#container").outerWidth();
    var newWidth = $("#container").width();
    $("#head").animate({width: newWidth});
    $("#head").css("marginLeft", myLeft).css("marginRight", myRight);
    $('.box').each(function() {
       $(this).delay(delay).fadeIn();
       delay += 250;
    });
 });
</code></pre>

<p>Then i run this but it does't work, ideally it would have to work on each window resize:</p>

<pre><code> function doSomething() {
   var myLeft = $("#container").offset().left;
   var myRight = myLeft + $("#container").outerWidth();
   var newWidth = $("#container").width();
   $("#head").animate({width: newWidth});
   $("#head").css("marginLeft", myLeft).css("marginRight", myRight);
  };

 var resizeTimer;
 $(window).resize(function() {
    clearTimeout(resizeTimer);
    resizeTimer = setTimeout(doSomething, 100);
 });
</code></pre>

<p>But it looks like as the new sizes are not applied each time there is a window resize, anyone?</p>
