title: jquery smooth scroll to an anchor in wordpress
body: <p>I'm trying to implement jquery smooth scroll to an anchor after clicking the menu item in the wordpress. I'm using this example:</p>
  
  <p><a href="http://jsfiddle.net/YtJcL/" rel="nofollow">http://jsfiddle.net/YtJcL/</a></p>
  
  <p>Here is the js file:</p>
  
  <pre><code> $(".anchor_scroll").click(function(event){
   event.preventDefault();
   //calculate destination place
   var dest=0;
   if($(this.hash).offset().top &gt; $(document).height()-$(window).height()){
      dest=$(document).height()-$(window).height();
  }else{
      dest=$(this.hash).offset().top;
  }
  //go to destination
  $('html,body').animate({scrollTop:dest}, 5000,'swing');
  });
  </code></pre>
  
  <p>In my wordpress page I create a section: </p>
  
  <pre><code>&lt;section id="services"&gt;&lt;/section&gt;
  </code></pre>
  
  <p>and in the wordpress custom menu put a class "anchor_scroll" to a link:</p>
  
  <pre><code>&lt;a class="anchor_scroll" href="#services"&gt;.
  </code></pre>
  
  <p>After this I'm able to navigate to an anchor in the page after pressing the link, however, the jquery code seems to be not working, because there is no smooth slide effect, just jump.</p>