Skip to content

Instantly share code, notes, and snippets.

@jsakhil
Last active April 8, 2021 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsakhil/fe6d04c59664ed8fb889a7a2fabf4058 to your computer and use it in GitHub Desktop.
Save jsakhil/fe6d04c59664ed8fb889a7a2fabf4058 to your computer and use it in GitHub Desktop.
Its for disabling scroll inside a section where onepage_sroll plugin is used
$('section').on('mouseenter', function(event) {
$('body').on('scroll mousewheel touchmove', stopScrolling);
});
$('section').on('mouseleave', function(event) {
$('body').off('scroll mousewheel touchmove', stopScrolling);
});
function stopScrolling(e) {
e.preventDefault();
e.stopPropagation();
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment