Set active tab without page view changing
<p>Using the following code to initialize tabs, then activate the tab selected in the url (mypage#this_tab, for example). The problem is on page load it shifts the view to the tab. Subsequent clicks on tabs do not shift the view. How can I fix the view to the top of the page on page load?</p>

<pre><code>&lt;!-- *********** Config tabs --&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function() {
  // When page loads...
  $(".tab_content").hide(); //Hide all content
  if (location.hash != "") {
    $(location.hash).show(); //Show selected tab content
    $("ul.apptabs li:has(a[href="+location.hash+"])").addClass("active").show();
  } else {
    $("ul.apptabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
  }
  // On Click Event
  $("ul.apptabs li").click(function() {

$("ul.apptabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content

var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
  });
});
&lt;/script&gt;
</code></pre>
