title: Adjust window height on click
body: <p>I have a div #more with width 100% and height auto that wraps my content. </p>
  
  <p>I want that div to resize to adjust window height on a link click.</p>
  
  <p>My script <strong>almost</strong> works, I click on the link, i see the scrollbar getting smaller (proof that the window has resized BUT the div resizes only <strong>after</strong> the first scroll action...why is that ? :(</p>
  
  <p>SCRIPT</p>
  
  <pre><code>$(document).ready(function(){
              $( "#target" ).click(function(){
    function resizeSection(tag) {
      var docHeight = $(window).height();  // Get the height of the browser window
      var docWidth = $(window).width();    // Get the width of the browser window
      $(tag).css({'height': docHeight + 'px', 'width': docWidth + 'px', 'display': 'block'});
    }
    $('#more').each(function(){  
      resizeSection(this);  // Call the function and make sure to pass 'this'
    });
    $(window).resize(function() {
      $('#more').each(function(){
        resizeSection(this);
      });
    });
  });
  });
  </code></pre>
  
  <p>And this is the trigger : <code>&lt;div id="target"&gt;click&lt;/div&gt;</code></p>