更改无效页面“标题" [英] Change inactive page 'Title'

查看:86
本文介绍了更改无效页面“标题"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我受 StackOverflow聊天的影响.
在此处,当页面处于非活动状态时,页面标题中会显示新的传入聊天消息的数量.激活页面后,该数字消失.如何在我的应用程序中实现这个概念?我也想突出显示该窗口.

I influenced from StackOverflow Chat.
Here when the page is inactive then number of the new incoming chat messages are displayed in the Page title. When the page is activated the this number is disappeared. How can I implement this concept in my application? I also want to highlight that window.

推荐答案

可以使用"window.onblur"(

detecting when it goes inactive can be done with 'window.onblur' (the onblur event)

可以使用"window.onfocus"( onfocus)来检测它何时再次启用事件)

detecting when it goes active again can be done with 'window.onfocus' (the onfocus event)

这篇关于更改无效页面“标题"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆