title: Tabs onclick jumps to top
body: <p>Using bootstrap, I have set an example up here: <a href="http://fixitup.com.au/clients/bootstrap/issue.html" rel="nofollow">http://fixitup.com.au/clients/bootstrap/issue.html</a></p>
  
  <p>Using scrollto for the main site, and also twitter bootstraps, tabs. I find that when you click on a tab the page jumps up.</p>
  
  <p>I added <code>onclick="return false;"</code> to the href of the tabs.</p>
  
  <p>Like:</p>
  
  <pre><code>&lt;ul id="myTab" class="nav nav-tabs"&gt;
  &lt;li class="active"&gt;&lt;a href="#about" data-toggle="tab" onclick="return false;"&gt;About Me&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="#ripoffs" data-toggle="tab" onclick="return false;"&gt;My Ripoffs&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I need scrollto and I need tabs... but I need to stop the page jumping, its driving me bonkers. Any suggestions ?</p>
  
  <p>Added: the js for the scroll is in aruo.js code below:</p>
  
  <pre><code>// Any links with hash tags in them (can't do ^= because of fully qualified URL potential)
      $('a[href*=#]').each(function() {
  
          // Ensure it's a same-page link
          var thisPath = filterPath(this.pathname) || locationPath;
          if (  locationPath == thisPath
              &amp;&amp; (location.hostname == this.hostname || !this.hostname)
              &amp;&amp; this.hash.replace(/#/,'') ) {
  
                  // Ensure target exists
                  var $target = $(this.hash), target = this.hash;
                  if ($(target).length &gt; 0) {
  
                      // Find location of target
                      var targetOffset = $target.offset().top;
                      $(this).click(function(event) {
  
                          // Prevent jump-down
                          event.preventDefault();
  
                          // Animate to target
                          $(scrollElem).animate({scrollTop: targetOffset}, 1100, 'swing', function() {
  
                              // Set hash in URL after animation successful
                              location.hash = target;
  
                          });
                      });
                  }
          }
  
      });
  
      // Use the first element that is "scrollable"  (cross-browser fix?)
      function scrollableElement(els) {
          for (var i = 0, argLength = arguments.length; i &lt;argLength; i++) {
              var el = arguments[i],
              $scrollElement = $(el);
              if ($scrollElement.scrollTop()&gt; 0) {
                  return el;
              } else {
                  $scrollElement.scrollTop(1);
                  var isScrollable = $scrollElement.scrollTop()&gt; 0;
                  $scrollElement.scrollTop(0);
                  if (isScrollable) {
                      return el;
                  }
              }
          }
          return [];
      }
  
  });
  </code></pre>