Change content of title tag, when switching to other open tab in the browser
browser, javascript, jquery
Solution
This works by registering Handlers on the `onfocus` and `onblur` events of `window`.
jQuery-Style:
$(window).on('blur', function() { ... });
Without jQuery:
window.onblur = function() { ... }
If that was not clear: the pages title can be read/written via `document.title`
Problem
I just recently saw this on two different websites, does anyone know how it is done? If you have multiple tabs open, and you leave the current one, the title in the tab is changed. Very nice trick! http://blog.invisionapp.com/ http://zerosixthree.se/create-a-responsive-header-video-with-graceful-degradation/