Skip to content

Instantly share code, notes, and snippets.

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