title: Prevent Window Location Movement On Hash Tags (With Jquery Tabs)
body: <p>Ok, i know theres plenty of previously asked questions, discussing this topic however i'm at a loss and haven't been able to figure it out. </p>
  
  <p><strong>My Problem</strong> is that when i click on each tab link the whole browser window moves to the anchor of the tab content <code>div</code> as you would expect on something like a scrollTop link for example. Does anyone know of a quick fix?</p>
  
  <p>I'm using a basic tab structure like this:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="tabContaier"&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#tab1"&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div class="tabDetails"&gt;
  
    &lt;div id="tab1"&gt;
      &lt;h1&gt;My Tab Title&lt;/h1&gt;
      &lt;p&gt;Whatever goes here&lt;/p&gt;
    &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>My Jquery is the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(".tabContents").hide();
  $(".tabContents:first").show();
  
  $("#tabContaier ul li a").click(function(){
  
    var activeTab = $(this).attr("href");
    $("#tabContaier ul li a").removeClass("active");
    $(this).addClass("active");
    $(".tabContents").hide();
    $(activeTab).fadeIn();
  });
  </code></pre>
  
  <p>As always, any help greatly appreciated :-)</p>