把下面代码放到网站头部或底部就可以啦,嘻嘻简单吧

<script>var OriginTitile=document.title;
var st;
document.addEventListener('visibilitychange',function(){
if(document.hidden){
document.title="(つェ⊂)我藏好了哦";
clearTimeout(st);
console.log('hide');
}else{
document.title='(*´∇`*) 被你发现啦~ '+OriginTitile;
console.log('show');
st=setTimeout(function(){
document.title=OriginTitile;
},4000);
console.log('endChange=');
}
});</script>
Last modification:February 14th, 2020 at 12:12 pm
If you think my article is useful to you, please feel free to appreciate