title: Use Bootstrap nav items to open and got to Tabs further down the page
body: <p>I am trying to link Bootstrap navigation items to Tabs on the same page.</p>
  
  <p>The desired action:</p>
  
  <p>Click on nav item > associated tab open >page scrolls down to the top of the tabs.</p>
  
  <p>I have been working with the following code, but can't get it to work. I can get the tab content to shift, but cannot get the active tab to change or the page to scroll down to the tabs</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Example of Bootstrap 3 Dynamic Tabs&lt;/title&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script type='text/javascript'&gt;
    $('#ProductDetailTabs a[data-toggle="tab"]').click(function (e) {
              e.preventDefault()
              $(this).tab('show')
          });
  
          $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
              var divId = $(e.target).attr("href")
              $('html,body').animate({ scrollTop: $(divId + 'Content').offset().top - 60 }, 500);
          });
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;nav class="navbar navbar-default"&gt;
    &lt;div class="container-fluid"&gt;
      &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
    &lt;div class="navbar-header"&gt;
        &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"&gt;
          &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;/button&gt;
        &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt;
      &lt;/div&gt;
  
      &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
      &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
        &lt;ul class="nav navbar-nav"&gt;
          &lt;li class="active"&gt;
          &lt;a data-toggle="tab" href="#sectionA" title="#sectionA" aria-controls="#sectionA"&gt;Section A&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
          &lt;a data-toggle="tab" href="#sectionB" title="#sectionB" aria-controls="#sectionB"&gt;Section B&lt;/a&gt;
          &lt;/li&gt;
          &lt;li&gt;
          &lt;a data-toggle="tab" href="#sectionC" title="#sectionC" aria-controls="#sectionC"&gt;Section C&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
    &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
  &lt;/nav&gt;
  
  
  
  
  
  
  
  
      &lt;ul class="nav nav-tabs" id="ProductDetailTabs" style="padding-top:1000px;"&gt;
          &lt;li class="active"&gt;&lt;a data-toggle="tab" href="#sectionA"&gt;Section A&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a data-toggle="tab" href="#sectionB"&gt;Section B&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a data-toggle="tab" href="#sectionC"&gt;Section C&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;div class="tab-content" id="ProductDetailsContent"&gt;
          &lt;div id="sectionA" class="tab-pane fade in active"&gt;
              &lt;h3&gt;Section A&lt;/h3&gt;
              &lt;p&gt;Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui. Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth.&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="sectionB" class="tab-pane fade"&gt;
              &lt;h3&gt;Section B&lt;/h3&gt;
              &lt;p&gt;Vestibulum nec erat eu nulla rhoncus fringilla ut non neque. Vivamus nibh urna, ornare id gravida ut, mollis a magna. Aliquam porttitor condimentum nisi, eu viverra ipsum porta ut. Nam hendrerit bibendum turpis, sed molestie mi fermentum id. Aenean volutpat velit sem. Sed consequat ante in rutrum convallis. Nunc facilisis leo at faucibus adipiscing.&lt;/p&gt;
          &lt;/div&gt;
          &lt;div id="sectionC" class="tab-pane fade"&gt;
              &lt;h3&gt;Section C&lt;/h3&gt;
              &lt;p&gt;WInteger convallis, nulla in sollicitudin placerat, ligula enim auctor lectus, in mollis diam dolor at lorem. Sed bibendum nibh sit amet dictum feugiat. Vivamus arcu sem, cursus a feugiat ut, iaculis at erat. Donec vehicula at ligula vitae venenatis. Sed nunc nulla, vehicula non porttitor in, pharetra et dolor. Fusce nec velit velit. Pellentesque consectetur eros.&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;                                     </code></pre>
  </div>
  </div>
  </p>