title: Exclude elements from function
body: <p>Whenever I click a tab, the window scrolls down after the click, because of the below code. How can I keep the smooth-scroll code, while excluding the below html (or using the jQuery selector in the function)?</p>
  
  <p>I have this code :</p>
  
  <pre><code>//smooth-scrolling
  $(function() {
      $('ul.nav a, .smooth').bind('click',function(event){
          var $anchor = $(this);
  
          // $("li[role='presentation'] &gt; a") &lt;- Remove this from the scrollTop fn
          $('html, body').stop().animate({
              scrollTop: $($anchor.attr('href')).offset().top
          }, 1500,'easeInOutExpo');
  
          event.preventDefault();
  
      });
  });
  </code></pre>
  
  <p>I'm not sure how to check if this is the element passed in, because the <code>.bind()</code> event is attached to what I am clicking :</p>
  
  <pre><code>&lt;ul class="nav nav-tabs" role="tablist"&gt;
      &lt;li role="presentation" class="active"&gt;&lt;a href="#focus" aria-controls="focus" role="tab" data-toggle="tab"&gt;Test Tab&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I know of the <code>:not()</code> selector, but I am not sure how to use it in this scenario (or where to put it, if it's the correct route). I could use something like <code>:not("role=tablist")"</code> perhaps(?), but I am not sure where to put it.</p>
  
  <p>I tried using an <code>if</code> statement on the selected element, but didn't seem to capture it correctly. I added a function that returned undefined before <code>scrollTop</code> hit - but that removed the functionality entirely (as it should have).</p>