Skip to content

Instantly share code, notes, and snippets.

@da2x
Created February 22, 2012 22:25
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 da2x/1887958 to your computer and use it in GitHub Desktop.
Save da2x/1887958 to your computer and use it in GitHub Desktop.
Idle user from scrolling
var userDidScroll = false;
document.addEventListener('scroll', function() { userDidScroll = true; }, false);
setInterval(function() {
if (userDidScroll)
{
userDidScroll = false;
opera.extension.postMessage('userScrolled');
}
}, 1500); // every 1.5 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment