0%

选项卡欺骗提示

选项卡欺骗提示

网页选项卡切换提示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* 状态栏判断
*/
function judgeState() {
var OriginTitle = document.title;
var titleTime;
document.addEventListener('visibilitychange', function () { //浏览器切换事件
if (document.visibilityState === 'hidden') { //状态判断
document.title = ' (╥﹏╥) 你快回来 ~ ';
clearTimeout(titleTime);
} else {
document.title = ' (∩_∩) 欢迎回来 ~ ' + OriginTitle;
titleTime = setTimeout(function () {
document.title = OriginTitle;
}, 1500);
}
});
console.log('%c欢迎来到DoubleAm的主页 ~ ', 'background:chocolate;border:1px solid tomato;border-radius:10px;box-sizing:border-box;color:yellow;font-size:26px;padding:13px;line-height:26px;');
}
bulb