<script>
    var OriginTitle = document.title; var titleTime;
    document.addEventListener('visibilitychange', 
function () {if (document.hidden) {
document.title = '访问其他窗口'; 
clearTimeout(titleTime);
} else 
{document.title = '访问当前窗口'; 
titleTime = setTimeout(function () {document.title = OriginTitle;}, 2000);
}});
</script>