Hexo NexT主题中添加网页标题崩溃欺骗搞怪特效 Posted on 2018-01-25 | In GitBlog | Visitors: 给网页title添加一些搞怪特效 crash_cheat.js在next\source\js\src文件夹下创建crash_cheat.js,添加代码:1234567891011121314151617<!--崩溃欺骗--> var OriginTitle = document.title; var titleTime; document.addEventListener('visibilitychange', function () { if (document.hidden) { $('[rel="icon"]').attr('href', "/img/TEP.ico"); document.title = '╭(°A°`)╮ 页面崩溃啦 ~'; clearTimeout(titleTime); } else { $('[rel="icon"]').attr('href', "/favicon.ico"); document.title = '(ฅ>ω<*ฅ) 噫又好了~' + OriginTitle; titleTime = setTimeout(function () { document.title = OriginTitle; }, 2000); } }); 引用在next\layout\_layout.swig文件中,添加引用(注:在swig末尾添加):12<!--崩溃欺骗--><script type="text/javascript" src="/js/src/crash_cheat.js"></script> ------------- 本 文 结 束 感 谢 您 的 阅 读 ------------- 坚持原创技术分享,您的支持将鼓励我继续创作! Donate WeChat Pay Alipay Post author: asdfv1929 Post link: https://asdfv1929.github.io/2018/01/25/crash-cheat/ Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.
Gitalking ...