title: Dynamically update height and margin using jQuery on resize
body: <p>I'm wondering if this is possible. I have set up a few lines of jQuery to fetch the height of each specific div on a page and negative top margin this so I can center my divs on screen (a standard method (<a href="http://goo.gl/R6HfF" rel="nofollow">http://goo.gl/R6HfF</a>))</p>
  
  <pre><code>$(window).load(function() {
      $('.each-web-project-info &gt; div').each(function() {
          eachWebProjectInfoHeight = $(this).height();
          $(this).css('height',eachWebProjectInfoHeight+'px');
          $(this).parent().css('margin-top',-eachWebProjectInfoHeight -35+'px');
      });
  });
  </code></pre>
  
  <p>The framework I'm building is responsive, so the width of the div is set in percentages (50%) with a -25% margin-left. So, as the screen scales, the position of the div won't be centered both vertically and horizontally.</p>
  
  <p>So, with that background, what I'm looking to do is alter my code so it fetches the height of each div and applies it to the margin-top as a negative on resize.</p>
  
  <p>Any help would be appreciated,
  -R</p>