title: Jquery UI Tabs changing Body Class
body: <p>I've tried the below script to no avail. I have a series of tabs at www.1tryten.com.  The tabs auto rotate and change on mouseover.  I'm trying to have it so that the currently active tab sets the class for the body tag.  Essentially, if tab-1 is active then the body class would be tab-1 etc.  Is this doable.</p>
  
  <pre><code>$(document).ready(function() {
  $("#tabs").tabs({
      event: 'mouseover',
      fx: {
          opacity: 'toggle',
          duration: 'slow',
          show: function(event, ui) { $("body").addClass(ui.tab);}
      }
  }).tabs('rotate', 5000, true);
  });
  </code></pre>
  
  <p>Here's the code for the tabs</p>
  
  <pre><code>&lt;div id="tabs" class="tabs-bottom ui-tabs ui-widget ui-widget-content ui-corner-all"&gt; 
      &lt;div id="tabsone" class="tabsone ui-tabs-panel ui-widget-content ui-corner-bottom" style=""&gt; 
      &lt;img src="/images/mac-mini-banner.png"&gt;
          &lt;h3&gt;Mac Mini Security Mount.  New Mac Mini Mount.&lt;/h3&gt;
  &lt;/div&gt; 
  &lt;div id="tabstwo" class="tabstwo ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" style=""&gt; 
      &lt;p&gt;Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.&lt;/p&gt; 
  &lt;/div&gt; 
  &lt;div id="tabsthree" class="tabsthree ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" style=""&gt; 
      &lt;p&gt;Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.&lt;/p&gt; 
      &lt;p&gt;Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.&lt;/p&gt; 
  &lt;/div&gt; 
              &lt;ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"&gt; 
                  &lt;li id="tabone" class="tabsone ui-state-default ui-corner-top ui-tabs-selected ui-state-active"&gt;&lt;a href="#tabsone"&gt;&lt;img src="/images/laptop-lock-tab-nav.png"&gt;&lt;/a&gt;&lt;/li&gt; 
      &lt;li id="tabtwo" class="tabstwo ui-state-default ui-corner-top"&gt;&lt;a href="#tabstwo"&gt;&lt;img src="/images/computer-lock-tab-nav.png"&gt;&lt;/a&gt;&lt;/li&gt; 
      &lt;li id="tabthree" class="tabsthree ui-state-default ui-corner-top"&gt;&lt;a href="#tabsthree"&gt;&lt;img src="/images/locker-tab-nav.png"&gt;&lt;/a&gt;&lt;/li&gt; 
  &lt;/ul&gt; 
  &lt;/div&gt;
  </code></pre>