当我在应用程序中收到消息时,我想突出显示/闪烁/刷新浏览器。现在,我正在使用下面的代码在标题栏中闪烁文本。
newExcitingAlerts = (function () {
var oldTitle = document.title;
var msg = "You have a new message!";
var timeoutId;
var blink = function() {
document.title = document.title == msg ? ' ' : msg;
$(".favicon").attr("href","/commonprov/web/images/webconsole/favicon-notify.ico");
};
var clear = function() {
clearInterval(timeoutId);
document.title = oldTitle;
window.onmousemove = null;
timeoutId = null;
$(".favicon").attr("href","/commonprov/web/images/webconsole/favicon.ico");
};
return function () {
if (!timeoutId) {
timeoutId = setInterval(blink, 1000);
window.onmousemove = clear;
}
};
}());
但是,如果在Window 10中将其最小化,我也希望任务栏中有Flash浏览器磁贴。