就像聊天一样(yahoomessenger,msn .....)当我们收到一条新消息时,相应的窗口会闪烁
或者在internet explorer中,当我们完成下载时,相应的窗口会在工具栏中闪烁。
如何使用弹出窗口完成此操作?
发布于 2010-10-15 04:42:14
您可以使用以下javascript来触发此操作。
window.focus();发布于 2010-10-15 04:43:23
这是不能从网页中的JavaScript访问的。但是,您可以将标题栏更改为字符串,如“!”然后再次返回以获得类似的效果。
示例代码(在http://jsbin.com/ifewu3/2上直播):
var oldTitle = '', titleBlanked = false, flashInterval;
flashInterval = setInterval(function () {
if(!titleBlanked) {
oldTitle = document.title;
document.title = '!!!!!!!!!!!!!!!!';
titleBlanked = true;
} else {
document.title = oldTitle;
titleBlanked = false;
}
}, 500);然后,当您想要停止闪烁时,调用clearInterval(flashInterval)。
https://stackoverflow.com/questions/3937356
复制相似问题