title: Highlight active anchor links with smooth scroll
body: <p>I'm using the smooth scroll script along side the simple JQuery for add and remove classes for anchor links.</p>
  
  <p>But both working separately but when you put them together the anchor highlight doesn't work.</p>
  
  <p>Here is the code</p>
  
  <pre><code>var $navyyLi = $(".navyy li");
  
  $navyyLi.click(function() {
    $navyyLi.removeClass('highlight')
    $(this).addClass('highlight');
  });
  
      $(function() {
        $('a[href*=#]:not([href=#])').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &amp;&amp; location.hostname == this.hostname) {
  
            var target = $(this.hash);
            target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
            if (target.length) {
              $('html,body').animate({
                scrollTop: target.offset().top
              }, 1000);
              return false;
            }
          }
        });
      });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/hLeQy/99/" rel="nofollow">JSFIDDLE</a></p>