Skip to content

Instantly share code, notes, and snippets.

@jazlalli
Created February 27, 2015 10:28
Show Gist options
  • Save jazlalli/d86dc3681e7d4316848b to your computer and use it in GitHub Desktop.
Save jazlalli/d86dc3681e7d4316848b to your computer and use it in GitHub Desktop.
Disable all pointer events when you're scrolling the window
.disable-hover,
.disable-hover * {
pointer-events: none !important;
}
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')
},100);
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment