(function() { var OriginTitile = document.title, titleTime; document.addEventListener(‘visibilitychange‘, function() { if (document.hidden) { document.title = ‘切换浏览器窗口‘; clearTimeout(titleTime); } else { document.title = ‘切回来‘; titleTime = setTimeout(function() { document.title = OriginTitile; },2000); } }); })();