Skip to content

Instantly share code, notes, and snippets.

@shyamsalimkumar
Created July 13, 2013 16:11
Show Gist options
  • Save shyamsalimkumar/5991195 to your computer and use it in GitHub Desktop.
Save shyamsalimkumar/5991195 to your computer and use it in GitHub Desktop.
Page Visibility API (code to check for page visibility)
document.addEventListener('visibilitychange', function(e) {
console.log('hidden:' + document.hidden,
'state:' + document.visibilityState)
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment