Skip to content

Instantly share code, notes, and snippets.

@tanmaypatel
Created December 10, 2013 08:11
Show Gist options
  • Select an option

  • Save tanmaypatel/7887202 to your computer and use it in GitHub Desktop.

Select an option

Save tanmaypatel/7887202 to your computer and use it in GitHub Desktop.
Disable Hover Effects on Scroll
.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