title: jQuery resize() using browser maximise button
body: <p>This is my code that fires whenever the window is resized:</p>
  
  <pre><code>$(window).resize(function()
  {   
      setDisplayBoardSize();
  });
  </code></pre>
  
  <p>Fires fine when I resize the window and runs my function just fine, as expected. </p>
  
  <p>If I hit the maximise button though it doesn't work correctly.</p>
  
  <p>This is the setDisplayBoardSize() function:</p>
  
  <pre><code>function setDisplayBoardSize()
  {
      var width = $(".display_container").width();
  
      for (i=min_columns; i&lt;=max_columns; i++)
      {
          if ((width &gt; (i*(item_width + gap))) &amp;&amp; (width &lt; ((i+1) * (item_width + gap))) )
          {
              $("#display_board").css("width",(i*(item_width + gap))+ "px");
          }
      }
  }
  </code></pre>
  
  <p>I think the problem is that when the browser maximise button is clicked it fires the function which reads gets the .display_container width <em>before</em> the resize and then resizes the window to maximum which means that my display_board is incorrectly sized.</p>
  
  <p>If I'm right how can I get the size of the .display_container element <em>after</em> the window has resized to maximum?</p>
  
  <p>Should note I've tested this in Chrome and Firefox</p>
  
  <p>Thanks</p>