document.addEventListener('visibilitychange', function () { if (document.visibilityState == 'hidden') { normal_title = document.title; document.title = '你有正在进行的操作哦!'; } else document.title = normal_title; });