Skip to content

Instantly share code, notes, and snippets.

@zolitch
Created December 9, 2013 16:50
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 zolitch/7875660 to your computer and use it in GitHub Desktop.
Save zolitch/7875660 to your computer and use it in GitHub Desktop.
Disable hover onscroll to speed up painting
function scrollListener(){
$window.scroll(function() {
//disable hover onscroll to speed up painting
$body.css({'pointer-events':'none'});
clearTimeout($.data(this, 'scrollTimer'));
$.data(this, 'scrollTimer', setTimeout(function() {
// do something
$body.css({'pointer-events':'inherit'});
}, 100));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment