title: Jquery Scroll on div using anchor tag is not Working properly
body: <p>I have added a jQuery code to scroll on different divs using anchor tags, The scroll works but when it reaches to the target div it scrolls back to the top of the page. This is the code that I wrote</p>
  
  <pre><code>$('a[href^="#"]').click(function(e) {
              e.preventDefault();
              var target = this.hash;
              var $target = $(target);
              $('html, body').animate({
                  'scrollTop': $target.offset().top - 160
              }, 1000).stop();
          });
  </code></pre>
  
  <p>Any suggestions?</p>