Loading... 笔记 修改网页标签变“呆萌” ```html <script> window.materialVersion = "3.2.0-preview-3" var titleTime; document.addEventListener('visibilitychange', function() { if (document.hidden) { document.title = '(*/ω\*) 哎哟~崩溃啦! XSY&Free sky ';//XSY&Free sky 这个改为你的原本的标签 clearTimeout(titleTime); } else { document.title = '(*´∇`*)咦!又好了? XSY&Free sky ';//XSY&Free sky 这个改为你的原本的标签 titleTime = setTimeout(function() { document.title = "XSY&Free sky";//XSY&Free sky 这个改为你的网站的标签 }, 2000); } }); </script> ``` Last modification:April 4, 2019 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 If you think my article is useful to you, please feel free to appreciate
2 comments
这样更好点吧
window.materialVersion = "3.2.0-preview-3" var titleTime; var Title = document.title; document.addEventListener('visibilitychange', function() { if (document.hidden) { document.title = '(*/ω\*) 哎哟~崩溃啦!'; clearTimeout(titleTime); } else { if (document.title != Title) { document.title = '(*´∇`*)咦!又好了?'; titleTime = setTimeout(function() { document.title = Title; }, 2000); } } });都差不多啦