title: IE, Javascript and Reflow
body: <p>I have a javascript function that changes the css display ('block', 'none') of a large number of dom nodes (>5000).  I am trying to make this as fast as possible.</p>
  
  <p>Will IE interrupt javascript to reflow and paint the screen, or will it wait until the javascript engine returns control to the browser?  I want to avoid any extra work from the browser until all nodes have had their display set.  </p>
  
  <p>I noticed in JQuery's show() method, DOM operations are put in a tight loop with the comment </p>
  
  <p>// Set the display of the elements in a second loop<br>
  // to avoid the constant reflow </p>
  
  <p>(<a href="http://code.google.com/p/jqueryjs/source/browse/trunk/jquery/src/fx.js" rel="nofollow noreferrer">http://code.google.com/p/jqueryjs/source/browse/trunk/jquery/src/fx.js</a> line 51)</p>
  
  <p>Thanks,</p>
  
  <p>James</p>