title: jquery ui accordions within tabs
body: <p>I’ve run into a problem using accordions within tabs, the initially inactive accordions do not render their content correctly when their tab is selected. 
  Reading around I see the reason for this is that the inactive tabs have display:none initially, so the height of the divs within the accordion do not get calculated correctly. None of the suggested solutions work for me.
  Have has anyone overcome this or have a work around?</p>
  
  <p>Here's some example code of the problem:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;link rel="stylesheet" type="text/css" href="../css/jquery-ui-1.7.2.custom.css" media="screen" /&gt;
    &lt;script type='text/javascript' src='../scripts/jquery-1.3.2.min.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' src='../scripts/jquery-ui-1.7.2.custom.js'&gt;&lt;/script&gt; 
  
    &lt;script type="text/javascript"&gt;
    $(document).ready(function(){
      $('#tabs').tabs();
      $("#accordion1").accordion();
      $("#accordion2").accordion(); 
    });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body style="font-size:62.5%;"&gt;
     &lt;div id="main" class="round roundB"&gt;
  
  &lt;div id="tabs"&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#tab1"&gt;Tab 1&lt;/a&gt; &lt;/li&gt;      
      &lt;li&gt;&lt;a href="#tab2"&gt;Tab 2&lt;/a&gt; &lt;/li&gt;
    &lt;/ul&gt;
  
  &lt;div id="tab1"&gt;
    &lt;div id="accordion1"&gt;
   &lt;h3&gt;&lt;a href="#"&gt;Section 1&lt;/a&gt;&lt;/h3&gt;
   &lt;div&gt;
    &lt;p&gt;
    TAB 1 Accordion 1
    &lt;/p&gt;
   &lt;/div&gt;
   &lt;h3&gt;&lt;a href="#"&gt;Section 2&lt;/a&gt;&lt;/h3&gt;
   &lt;div&gt;
    &lt;p&gt;
    TAB 1 Accordion 2
    &lt;/p&gt;
   &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div id="tab2"&gt;
    &lt;div id="accordion2"&gt;
   &lt;h3&gt;&lt;a href="#"&gt;Section 1&lt;/a&gt;&lt;/h3&gt;
   &lt;div&gt;
    &lt;p&gt;
    TAB 2 Accordion 1
    &lt;/p&gt;
   &lt;/div&gt;
   &lt;h3&gt;&lt;a href="#"&gt;Section 2&lt;/a&gt;&lt;/h3&gt;
   &lt;div&gt;
    &lt;p&gt;
    TAB 2 Accordion 2
    &lt;/p&gt;
   &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>