title: scroll speed with mousewheel jquery plugin
body: <p>I want to imitate the <a href="https://plus.google.com/" rel="nofollow noreferrer">Google+</a> header with the search bar. When you scroll down it goes to <code>top:-60px</code> and the second horizontal menu will be <code>top:0</code> from <code>top:60px</code> and become the main top horizontal menu, while the one with <code>top:-60px</code> remains hidden until we scroll to top.</p>
  
  <p>I managed to do this, but it only works when I scroll slowly (with trackpad, OSX, Chrome33). I researched and found out the scroll speed depends on the hardware (touchpad, mouse), the OS and even on the browser. I found <a href="https://github.com/brandonaaron/jquery-mousewheel" rel="nofollow noreferrer">mousewheel</a> plugin, that aims to make the scrolling speed equal but I can't make it work.</p>
  
  <p>Here is the js code: ( The delta divisions I got from here: <a href="https://stackoverflow.com/a/16696129">https://stackoverflow.com/a/16696129</a> )</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      gn_top_menu_featured = $('.gn-top-menu-featured'),
      gn_top_menu = $('.gn-top-menu'),
      hide_gn_top_menu_featured = 0,
      gn_top_menu_position = 44;
      $('body').on('mousewheel', function(event) {
          if( event.deltaX &gt;= 40 )
              event.deltaX /= 40;
          if( event.deltaY &gt;= 40 )
              event.deltaY /= 40;
          var sy = $('body').scrollTop();
          if ( sy &gt;= hide_gn_top_menu_featured &amp;&amp; sy &lt;= gn_top_menu_position ) {
              gn_top_menu_featured.css('top', -sy);
              gn_top_menu.css('top', gn_top_menu_position-sy);
          }
          else {
              // whatever
          }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I really want to get this working properly, thank in advance. :)</p>