title: JQuery: $(window).resize() not working
body: <p>I'm trying to manually fire the $(window).resize() method on page load.
  I created a function to center a div element vertically and horizontally on the page</p>
  
  <pre><code>$(window).resize(function(){
      $('.pagecentered').css({
          position: 'absolute',
          left: ($(window).width() - $('.pagecentered').outerWidth())/2,
          top: ($(window).height() - $('.pagecentered').outerHeight())/2
      });
  });
  </code></pre>
  
  <p>After this function I call</p>
  
  <pre><code>$(window).resize();
  </code></pre>
  
  <p>to fire the resize() event manually.</p>
  
  <p>Unfortunately it doesn't work. On reload the div is not centered as expected.
  If I resize the browser window the div element is centered it only isn't fired on page load.</p>
  
  <p>Is there any way to solve this?
  I'm using Chrome 27.0.1453.116 m (latest version atm) and JQuery 1.10.2</p>