Back

教大家如何让网站的标题会变

Small color 2016年11月22日

1.jpg

1.png

2.png

今天在某群里,有人问如何实现网站的标题在别人浏览不是自己的网站的时候就会变(崩溃啦)什么什么卖萌的标题。
后来他给我会变标题的网站,我就去爬下!
代码如下

<script type="text/javascript">
    var OriginTitle = document.title;
var st; 
document.addEventListener('visibilitychange', function() { 
    if (document.hidden) { 
       
        document.title = '(●—●)喔哟,崩溃啦!'; clearTimeout(st);
        st2 = setTimeout(function() { document.title = OriginTitle; 
        }, 10000)
    } else { 
        document.title = '(/≧▽≦/)咦!又好了!' + OriginTitle;clearTimeout(st2); 
         st = setTimeout(function() { document.title = OriginTitle; 
        }, 2000); 
    } });
</script>

把这段代码复制到自己的网站里即可!要改什么鬼标题都行啦!

注意:
  • 担心迷路?请收藏备用网址:smallcolor.top  备用网址2:smallcolor.org
  • 免责声明:本站为非营利性站点,本网站提供的资源均系收集于各大外网网站,本网站只提供web页面服务,并不提供影片资源存储和下载,也不参与录制、上传、翻译。
  • Disclaimer: This site for non-profit site, this website provides the resources are collected in each big web site, the site provides web page service only, does not provide video resources storage and download, or recording, upload, translation will not be involved.
  • 本站严格遵守(CC BY-NC-SA 4.0)国际许可协议,所有信息我都注明来源。
  • This website strictly complies with the (CC BY-NC-SA 4.0) international license agreement and indicates the source of all information.
  • 若本站收录的节目无意侵犯了贵司版权,请给下面邮箱地址来信(或者留言),我们会及时处理和回复,谢谢!
  • If the content included in this website is not intended to infringe your copyright, please send a letter to the following email (or message), we will promptly handle and reply, thank you for your support!
  • 富强、民主、文明、和谐,自由、平等、公正、法治,爱国、敬业、诚信、友善。
  • emoji_u1f625.pngemoji_u1f629.pngicon_twisted.pngemoji_u1f62a.pngemoji_u1f61c.pngemoji_u1f64d.pngemoji_u1f618.pngemoji_u1f611.pngicon_cool.pngemoji_u1f61e.pngicon_wink.pngicon_neutral.pngicon_smile.pngemoji_u1f646.pngemoji_u1f620.pngemoji_u1f626.pngemoji_u1f623.pngicon_razz.pngemoji_u1f603.pngemoji_u1f62b.pngicon_eek.pngemoji_u1f605.png
    >Submit

      商业友情链接:

    >