Skip to content

Instantly share code, notes, and snippets.

@lawvs
Created February 26, 2018 02:25
Show Gist options
  • Save lawvs/e7783c786ced9c8bd3492cfe45ca4c31 to your computer and use it in GitHub Desktop.
Save lawvs/e7783c786ced9c8bd3492cfe45ca4c31 to your computer and use it in GitHub Desktop.
html标签状态改变时改变html标题
document.addEventListener('visibilitychange', function () {
document.hidden ? document.title = '(●—●)喔哟,崩溃啦!'
: document.title = '(/≧▽≦/)咦!又好了!'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment