Skip to content

Instantly share code, notes, and snippets.

@diegoslva
Last active December 30, 2015 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegoslva/7816247 to your computer and use it in GitHub Desktop.
Save diegoslva/7816247 to your computer and use it in GitHub Desktop.
desativar os efeitos de hover durante o scroll da pagina

Esse script Soluciona o Problema das altas taxas de frames por segundo(fps) durante o scroll da pagina.

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