Skip to content

Instantly share code, notes, and snippets.

@xiaohutai
Last active December 29, 2015 10:09
Show Gist options
  • Save xiaohutai/7655242 to your computer and use it in GitHub Desktop.
Save xiaohutai/7655242 to your computer and use it in GitHub Desktop.
.disable-hover,
.disable-hover * {
pointer-events: none !important;
}
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment