title: Trigger Tab activate function - JQuery UI Tabs
body: <p>I run into problem.</p>
  
  <p>HTML snippet looks like this</p>
  
  <pre><code>&lt;div id="mainTab"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;a href='#tabs-1'&gt;TabGroup1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href='#tabs-2'&gt;TabGroup2&lt;/a&gt;&lt;/li&gt;            
      &lt;/ul&gt;
      &lt;div id='tabs-1'&gt;
          &lt;a onclick="showSubTab1Tab2();"&gt;showSubTab1Tab2&lt;/a&gt;
          &lt;a onclick="showSubTab2Tab2();&gt;showSubTab2Tab2&lt;/a&gt;
      &lt;/div&gt;
      &lt;div id='tabs-2'&gt;
          &lt;!-- First Sub Tab --&gt;
          &lt;div id="subTab1"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a href='#tabs-3'&gt;TabGroup3&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href='#tabs-4'&gt;TabGroup4&lt;/a&gt;&lt;/li&gt;            
              &lt;/ul&gt;
              &lt;div id='tabs-3'&gt;
  
              &lt;/div&gt;
              &lt;div id='tabs-4'&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!-- Second Sub Tab --&gt;
          &lt;div id="subTab2"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a href='#tabs-5'&gt;TabGroup5&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href='#tabs-6'&gt;TabGroup6&lt;/a&gt;&lt;/li&gt;            
              &lt;/ul&gt;
              &lt;div id='tabs-5'&gt;
  
              &lt;/div&gt;
              &lt;div id='tabs-6'&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And javascript look like this. I am using JQuery UI 1.10.3</p>
  
  <pre><code>$("#mainTab").tabs();
  
  $( "#subTab1" ).tabs({
      activate: function( event, ui ) {
          // Update Some Logs
      }
  });
  
  $( "#subTab2" ).tabs({
      activate: function( event, ui ) {
          // Update Some Logs
      }
  });
  
  function showSubTab1Tab2() {
      $("#mainTab").tabs( "option", "active", 1);
      $( "#subTab1" ).tabs( "option", "active", 1);
  }
  
  function showSubTab2Tab2() {
      $("#mainTab").tabs( "option", "active", 1);
      $( "#subTab2" ).tabs( "option", "active", 1);
  }
  </code></pre>
  
  <p>If User click on "showSubTab2Tab2". I changed the main tab. Take the user to second tab. and then activate the second tab of subTab2 and If the tab is not previously active This will activate the second tab and fires activate event</p>
  
  <p>Now here is the problem. If user do that twice then on second time the activate event is not fired. I need that event to log/populate some code on frontent. </p>
  
  <p>I can't do that in my function.</p>