JS 根据浏览器标签页是否被选中改变标签页title
$(function(){
var OriginTitile = document.title, titleTime;
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
document.title = 'Come back !';
clearTimeout(titleTime);
} else {
document.title = 'Welcome to MyHome';
titleTime = setTimeout(function() {
document.title = OriginTitile;
},3000);
}
});
})