title: Scroll function should not scroll to top
body: <p>I have this script on my onepage and it works fine. But I need the script not be able to scroll to the first class section.</p>
  
  <p>Is that possible?</p>
  
  <pre><code>$(document).ready(function () {
  var divs = $('.section');
  var dir = 'up'; // wheel scroll direction
  var div = 0; // current div
  $(document.body).on('DOMMouseScroll mousewheel', function (e) {
      if (e.originalEvent.detail &gt; 0 || e.originalEvent.wheelDelta &lt; 0) {
          dir = 'down';
      } else {
          dir = 'up';
      }
      // find currently visible div :
      div = -1;
      divs.each(function(i){
          if (div&lt;0 &amp;&amp; ($(this).offset().top &gt;= $(window).scrollTop())) {
              div = i;
          }
      });
      if (dir == 'up' &amp;&amp; div &gt; 0) {
          div--;
      }
      if (dir == 'down' &amp;&amp; div &lt; divs.length) {
          div++;
      }
      //console.log(div, dir, divs.length);
      $('html,body').stop().animate({
          scrollTop: divs.eq(div).offset().top
      }, 1300);
      return false;
  });
  $(window).resize(function () {
      $('html,body').scrollTop(divs.eq(div).offset().top);
  });
  </code></pre>
  
  <p>});</p>