Skip to content

Instantly share code, notes, and snippets.

@Calerme
Created October 19, 2018 06:14
Show Gist options
  • Save Calerme/47209d3fe990830b95b9d67b2d550817 to your computer and use it in GitHub Desktop.
Save Calerme/47209d3fe990830b95b9d67b2d550817 to your computer and use it in GitHub Desktop.
禁止 scrollbar 拖动
document.addEventListener('scroll', function (e) {
e.preventDefault();
e.stopPropagation();
document.documentElement.scrollTop = 0;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment