title: jQuery hide() method doesn't immediately take effect in IE8?
body: <p>What we have are some images that are vertically center-aligned via jQuery. What we want to happen is to hide the misaligned images (meaning, not centered) on <code>$(document).ready</code> then run the function for centering on <code>window.onload</code> then show the images after that.</p>
  
  <p>The images hide immediately on Firefox and Chrome when the page is loaded. But in IE8, for a brief second, it still shows the misaligned images before hiding them.</p>
  
  <p>Is there a way for IE8 to hide them faster/immediately? Below is the code:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  $(document).ready(function() {
      $('.img_mask img').hide();
  });
  
  window.onload = function() {
      $('.img_mask img').each(function() {
          var $img = $(this);
          var h = $img.height();
          var w = $img.width();
          $img.css('margin-top', +h / -2 + "px").css('margin-left',+ w/ -2 + "px");
          $('.img_mask img').show();
      });
  </code></pre>