Skip to content

Instantly share code, notes, and snippets.

@skyblue
Last active March 10, 2017 02:34
Show Gist options
  • Select an option

  • Save skyblue/1443211 to your computer and use it in GitHub Desktop.

Select an option

Save skyblue/1443211 to your computer and use it in GitHub Desktop.
visibilitychange event
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