Triangle-MX/Triangle-4.0

Not blocked scroll while on menu

Opened this issue · 4 comments

While the user is on the menu the scroll is not blocked as expected.

 $(window).bind('mousewheel', function(event) { event.preventDefault(); }); 

This snippet blocks scrolling, however, it seems the only way of cancelling it is to reload the page. Will look into alternatives.

For mobile:

$(window).bind('touchmove', function(event) { event.preventDefault(); });

Branch menu-issues created to solve this issue.

Managed to get it blocked when user opens the menu, but only managed to unblock it if the user clicks outside the menu trigger.

// Block
$('body').bind('mousewheel', function(event) { event.preventDefault(); });
$('body').bind('touchmove', function(event) { event.preventDefault(); });

// Unblock
$('body').unbind('mousewheel');
$('body').unbind('touchmove');