Created
December 4, 2017 07:23
-
-
Save wi24rd/1cea7d61cf1b77cc24a12d3cc20e5d43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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='); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment