0

Can anybody help me?

I need to prevent mouse scrolling and preserve menu navigation.
Demo website here
Jquery script and code here.


I've already tried with 'overflow : hidden' (in CSS or JS) but it streangely desable the menu as well...

// Scroll Spy
$(window).scroll(function() {
  var top = $(window).scrollLeft() + 100; // Take into account height of fixed menu
  $(".container").each(function() {
    var c_top = $(this).offset().top;
    var c_bot = c_top + $(this).height();
    var hash = $(this).attr("id");
    var li_tag = $('a[href$="' + hash + '"]').parent();
    if ((top > c_top) && (top < c_bot)) {

      if (li_tag.hasClass("active")) {
        return false;
      }
      else {
        li_tag.siblings().andSelf().removeClass("active");
        li_tag.addClass("active");
        $(".menu ul li.active a").slideToPos();  
        }
    }
  });
});
Antonio dS
  • 96
  • 3

1 Answers1

0

I solved the problem like this :

<script type="text/javascript">
        function stop()
        {
            return false;
        }
        document.onmousewheel=stop;

It prevents mouse scrolling, preserving menu navigation. Hope will help!

Antonio dS
  • 96
  • 3