title: Stop Bootstrap accordion from scrolling
body: <p>I am using a function for smooth scrolling which seems to interfere with a FAQs accordion. When opening or closing any question tab that tab jumps to the top of the page. When leaving href* here</p>
  
  <pre><code>return this.find('a[href*="#"]').click(function(f) {
  </code></pre>
  
  <p>empty accordion works but smooth scrolling is disabled. Can't find a way to make both functions work simultaneously.</p>
  
  <p>How can I prevent the FAQs tabs from jumping to the top and opening at their actual position without loosing the smooth scrolling?</p>
  
  <pre><code>(function(a, c) {
      var b = (function() {
          var d = c(a.documentElement),
              f = c(a.body),
              e;
          if (d.scrollTop()) {
              return d
          } else {
              e = f.scrollTop();
              if (f.scrollTop(e + 1).scrollTop() == e) {
                  return d
              } else {
                  return f.scrollTop(e)
              }
          }
      }());
      c.fn.smoothScroll = function(d) {
          d = ~~d || 600;
          return this.find('a[href*="#"]').click(function(f) {
              var g = this.hash,
                  e = c(g);
              if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') &amp;&amp; location.hostname === this.hostname) {
                  if (e.length) {
                      f.preventDefault();
                      b.stop().animate({
                          scrollTop: e.offset().top
                      }, d, function() {
                          location.hash = g
                      })
                  }
              }
          }).end()
      }
  }(document, jQuery));
  </code></pre>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;div class="panel-group" id="accordion"&gt;
      &lt;div class="faqHeader"&gt;General questions&lt;/div&gt;
      &lt;div class="panel panel-default collapse"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne"&gt;How fit and Experienced do I need to be for the Cycling Escapes?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseOne" class="panel-collapse collapse in"&gt;
              &lt;div class="panel-body"&gt;
                  No, you don’t need to be a pro to ride our Cycling Escapes.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo"&gt;How serious is the cycling?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseTwo" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  Our Escapes are all about cycling, of course, but they are not stage races.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFourteen"&gt;Do I have to ride every day?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseFourteen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  Absolutely not. You can take as many days off as you want.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThree"&gt;Can you help me with my fitness preparation?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseThree" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  Sure we can.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFour"&gt;Is there a minimum age requirement?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseFour" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  Yes, there is.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFive"&gt;How big are the groups?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseFive" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  The groups are limited to 16 riders.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseSix"&gt;Can I rent a bike and/or a GPS navigation system with you?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseSix" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  At the moment we cannot offer rentals for bikes or GPS navigation system. Sorry.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br&gt;
  
      &lt;div class="faqHeader"&gt;Accommodation&lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseSeven"&gt;Do I have to share my accomomodation with another rider?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseSeven" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  All the prices of our Escapes are based on two people sharing a room.
                  &lt;br /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseEight"&gt;Is my bike safely stored when I'm not riding?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseEight" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  There are a number of reasons why you should join us:
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
       &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseSixteen"&gt;Can you accommodate special dietary needs?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseSixteen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  We will do our very best to ensure that your dietary needs are met.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;br&gt;
  
      &lt;div class="faqHeader"&gt;Prices&lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseNine"&gt;How much does it cost?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseNine" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  You can find the cost for the individual Escapes in the 'ESCAPES' section of the website.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTen"&gt;What is included in the Escape price?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseTen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Accommodation for 7 or 10 nights in a 3 to 5 star hotel.&lt;/li&gt;
                  &lt;/ul&gt; 
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseThirteen"&gt;What is NOT included in the Escape price?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseThirteen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Flights and/or train travels.&lt;/li&gt;
                  &lt;/ul&gt; 
              &lt;/div&gt;
          &lt;/div&gt;
       &lt;/div&gt;
       &lt;br&gt;
       &lt;div class="faqHeader"&gt;Bookings&lt;/div&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading"&gt;
                  &lt;h4 class="panel-title"&gt;
                      &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseSeventeen"&gt;How do I book?&lt;/a&gt;
                  &lt;/h4&gt;
              &lt;/div&gt;
              &lt;div id="collapseSeventeen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
              Bookings can be made via the 'BOOKINGS' section of the website.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseEighteen"&gt;Can I cancel my booking?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseEighteen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
              Of course you can. You can cancel your booking at any time, but be aware that charges will apply and refunds are based on a sliding scale.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;div class="faqHeader"&gt;Travel/Transportation&lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseEleven"&gt;Can you help me with travel arrangements?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseEleven" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  Unfortunately, we are not able to help you with any travel arrangements outside our Escapes.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwelve"&gt;Do I need travel insurance?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseTwelve" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  Yes, we strongly recommend that you take out a travel insurance as this is not included in any of our Escape prices.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseFifteen"&gt;What travel documents do I need?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseFifteen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
                  A passport or an identity card is the most obvious.
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;div class="faqHeader"&gt;Hey!&lt;/div&gt;
      &lt;div class="panel panel-default"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseNineteen"&gt;Why didn't you answer my question?&lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapseNineteen" class="panel-collapse collapse"&gt;
              &lt;div class="panel-body"&gt;
              Sorry. So many questions, so many answers...
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;style&gt;
  .faqHeader {
      font-size: 27px;
      margin: 15px;
      text-transform: uppercase;
  }
  
  .panel-heading [data-toggle="collapse"]:after {
      font-family: 'FontAwesome';
      content: "\f138"; /* "play" icon; old icon: Glyphicons Halflings, e072*/
      float: right;
      color: #F58723;
      font-size: 30px;
      line-height: 27px;
      /* rotate "play" icon from &gt; (right arrow) to down arrow */
      -webkit-transform: rotate(-90deg);
      -moz-transform: rotate(-90deg);
      -ms-transform: rotate(-90deg);
      -o-transform: rotate(-90deg);
      transform: rotate(-90deg);
  }
  
  .panel-heading [data-toggle="collapse"].collapsed:after {
      /* rotate "play" icon from &gt; (right arrow) to ^ (up arrow) */
      -webkit-transform: rotate(90deg);
      -moz-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
      -o-transform: rotate(90deg);
      transform: rotate(90deg);
      color: #454444;
  }
  </code></pre>
  
  <p></p>