Last active
August 29, 2015 14:03
-
-
Save seanwalsh/8b6fe8fb96eeda416121 to your computer and use it in GitHub Desktop.
Change the title tag when the user goes to another window/tab.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onblur = function () { document.title = 'Your new HTML Title tag'; } | |
window.onfocus = function () { document.title = 'The default title tag'; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change Title Tag | |
var currentTitle = document.title; | |
window.onblur = function () { document.title = 'Hey, over here.'; } | |
window.onfocus = function () { document.title = currentTitle; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment