Skip to content

Instantly share code, notes, and snippets.

@heroheman
Created March 19, 2014 09:59
Show Gist options
  • Select an option

  • Save heroheman/9638750 to your computer and use it in GitHub Desktop.

Select an option

Save heroheman/9638750 to your computer and use it in GitHub Desktop.
JS: 60fps Scrolling
(function($) {
'use strict';
$(document).ready(function(){
// 60fps scrolling
// see: http://www.thecssninja.com/javascript/pointer-events-60fps
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);
});
navToggle.init();
vichyAccordion.init();
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment