title: scrolling up with jquery waypoints
body: <p>I am using jquery waypoints plugin for a one page scrolling site. there is a fixed top menu.</p>
  
  <pre><code>&lt;ul id="main_nav"&gt;
    &lt;li&gt;&lt;a href="#home"&gt;home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#about"&gt;about&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#contact"&gt;contact&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>The content divs are like this:</p>
  
  <pre><code>&lt;div id="content"&gt;
    &lt;div id="home" class="page_content"&gt;Content here&lt;/div&gt;
    &lt;div id="about" class="page_content"&gt;Content here&lt;/div&gt;
    &lt;div id="contact" class="page_content"&gt;Content here&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My scrolling is working fine. but problem is waypoints. If I click a link, the menu is selected (adding a class - current). I am using waypoint to do the same thing for scrolling the page. when scrolling down, it works fine. but does not work perfectly for scrolling up. It needs to be moved some more top. then it works. If I use offset -1%, then it works for scrolling up. but then there is problem for down scrolling. here is my js code:</p>
  
  <pre><code>// CODE FOR SCROLLING
  $('ul#main_nav a').bind('click',function(event){
      $('ul#main_nav a').removeClass("current");
      $(this).addClass("current");
      var $anchor = $(this);
  
      $('html, body').stop().animate({
          scrollTop: $($anchor.attr('href')).offset().top
      }, 1500,'easeInOutExpo');
      event.preventDefault();
  });
  
  // CODE FOR WAYPOINT
  $('.page_content').waypoint({offset: '0%'});
  $('.page_content').bind('waypoint.reached', function(event, direction) {
     var wayID = $(this).attr('id');
     $('.current').removeClass('current');
     $('#main_nav a[href=#'+wayID+']').addClass('current');       
  });
  </code></pre>