下面小编就为大家带来一篇javascript实现任务栏消息提示的简单实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。
javascript实现任务栏消息提示的简单实例
代码如下:
<html>
<body onload="blurFunc();">
<script>
function blurFunc()
{
setTimeout("setTitle1()","1000");
}
var flag=0;
var id = setTimeout("setTitle1()","1000");
var id1 = setTimeout("setTitle2()","1000");
function setTitle1()
{
if(flag=="1")
{
return;
}
document.title="消息提醒";
setTimeout("setTitle2()","1000");
}
function setTitle2()
{
document.title="XXXXXX";
setTimeout("setTitle1()","1000");
}
setTimeout("clear()",10000);
function clear()
{
flag = "1";
}
</script>
</body>
</html>
以上这篇javascript实现任务栏消息提示的简单实例就是小编分享给大家的全部内容了,希望能给大家一个参考