Skip to content

Instantly share code, notes, and snippets.

@msrafi
Created August 18, 2015 03:12
Show Gist options
  • Save msrafi/3f7eb971ccf470781537 to your computer and use it in GitHub Desktop.
Save msrafi/3f7eb971ccf470781537 to your computer and use it in GitHub Desktop.
var didScroll = false;
window.onscroll = doThisStuffOnScroll;
function doThisStuffOnScroll() {
didScroll = true;
}
setInterval(function() {
if(didScroll) {
didScroll = false;
console.log('You scrolled');
}
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment