title: jQuery smooth scroll for WordPress not working
body: <p>I've been trying to make my links work on my theme I am creating but I have no knowledge of jQuery for the smooth scrolling. In my theme I used the following jQuery I saw was working online:</p>
  
  <pre><code>$(document).ready(function(){
      $('a[href^="#"]').on('click',function (e) {
          e.preventDefault();
  
          var target = this.hash;
          var $target = $(target);
  
          $('html, body').stop().animate({
              'scrollTop': $target.offset().top
          }, 900, 'swing', function () {
              window.location.hash = target;
          });
      });
  });
  </code></pre>
  
  <p>In my dynamic WordPress menu I set the urls to #values, #about, #contact etc. and the links to it on the specific places on the page I used <code>&lt;span id="values"&gt;&lt;/span&gt;, &lt;span id="about"&gt;&lt;/span&gt; and &lt;span id="contact"&gt;&lt;/span&gt;</code></p>
  
  <p>It works, but the smooth scrolling doesn't work. I see that anchors are used for smooth scrolling online in the parts of the page but I want to be able to target the id of the span tags. I tried to make an anchor tag to test if it works but it still doesn't.</p>
  
  <p>How do I get this to work?</p>