Skip to content

Instantly share code, notes, and snippets.

@beardlessman
Created December 29, 2017 07:21
Show Gist options
  • Save beardlessman/3c9db5f647458221dd89b251bc1211af to your computer and use it in GitHub Desktop.
Save beardlessman/3c9db5f647458221dd89b251bc1211af to your computer and use it in GitHub Desktop.
отключаем события по скроллу
var body = document.body,
timer;
window.addEventListener('scroll', function() {
clearTimeout(timer);
if (!body.classList.contains('disable-hover')) {
body.classList.add('disable-hover');
}
timer = setTimeout(function(){
body.classList.remove('disable-hover');
}, 500);
}, false);
// css
.disable-hover {
pointer-events: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment