title: Click Tab, Tabs Disappear
body: <p>Creating tabs in jQuery.  When you click another tab, all the tabs disappear.  Can't figure out the fix</p>
  
  <p>Here's the page not working: <a href="http://www.sleepfullnights.com/products/sfn-537" rel="nofollow">http://www.sleepfullnights.com/products/sfn-537</a></p>
  
  <p>Here's the JSFiddle another guy made of it working: <a href="http://jsfiddle.net/gravitybox/7pHg4/" rel="nofollow">http://jsfiddle.net/gravitybox/7pHg4/</a>  I've copied and pasted every element of this into the page and the issue is still there.</p>
  
  <p>One person pointed out that something is giving the tabs the css "display:none" when clicked and I can't find where to fix it.</p>
  
  <p>Also, another observation someone made was that "In Chrome dev tools, if you right click the ul.tabs in the "Elements" tab and select "Break On > Attributes modifications", it breaks on "$(contentLocation).show().addClass('active').siblings().hide().removeClass('act‌​ive');" when you click a tab".</p>
  
  <p>Here's the jQuery code I have:</p>
  
  <pre><code>     $(document).ready(function() {
      $('ul.tabs').each(function(){
        var active, content, links = $(this).find('a');
        active = links.first().addClass('active');
        content = $(active.attr('href'));
        links.not(':first').each(function () {
          $($(this).attr('href')).hide();
        });
        $(this).find('a').click(function(e){
          active.removeClass('active');
          content.hide();
          active = $(this);
          content = $($(this).attr('href'));
          active.addClass('active');
          content.show();
          return false;
        });
      });
    });
  </code></pre>
  
  <p>And the code from the working JSFiddle:</p>
  
  <pre><code>    $(document).ready(function() {
  
  $('ul.tabs').each(function(){
    var active, content, links = $(this).find('a');
    active = links.first().addClass('active');
    content = $(active.attr('href'));
    links.not(':first').each(function () {
      $($(this).attr('href')).hide();
  
    });
    $(this).find('a').click(function(e){
      active.removeClass('active');
      content.hide();
      active = $(this);
      content = $($(this).attr('href'));
      active.addClass('active');
      content.show();
      return false;
        alert('yep');
    });
  });
  });
  </code></pre>
  
  <p>Any help/guidance is greatly appreciated.</p>