比这篇新的文章: Movable Type生成sitemap.xml的模板
比这篇旧的文章: Javascript string escapeHTML

Javascript - 后台窗口来消息时标题栏闪烁

语言: JavaScript, 标签: 无  2009/04/16发布 11个月前更新 更新记录
作者: 半瓶墨水, 点击817次, 评论(0), 收藏者(0), , 打分:

背景
主题: 字体:
01 //from: http://stackoverflow.com/questions/37122/make-browser-window-blink-in-task-bar
02 /*
03 this won't make the taskbar button flash in changing colours, but the title will blink on and off until they move the mouse. This should work cross platform, and even if they just have it in a different tab.
04 */
05 function clear_blink(oldTitle) {
06   clearInterval(g_timeout_id);
07   g_timeout_id = null;
08   document.title = oldTitle;
09   document.onmousemove = null;
10   document.onkeydown = null;
11 }
12 function blink_info(msg) {
13   var oldTitle = document.title;
14   if (typeof(g_timeout_id) != "undefined" && g_timeout_id) {
15     clearInterval(g_timeout_id);
16   }
17   g_timeout_id = setInterval(function() {
18       document.title = document.title == msg ? ' ' : msg;
19     }, 500);
20   document.onmousemove = function() { clear_blink(oldTitle); };
21   document.onkeydown = function() { clear_blink(oldTitle); };
22 }


所有评论,共0条:( 我也来说两句)


发表评论

注册登录后再发表评论