title: Bootstrap tabs: Open tab and scroll
body: <p>I want to link the Messages tab and once user clicks on that link it should open the tab and scroll.</p>
  
  <p>The scroll function is working but how can I set the tab as active?</p>
  
  <pre><code>$('a.js-link-scroll').on('shown.bs.tab', function (e) {
      var that = this;
      $('html, body').animate({
          scrollTop: $( $(that).attr('href') ).offset().top
      }, 500);
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/brunodd/mn83jsa2/" rel="nofollow">jsFiddle</a></p>