网页即时聊天工具,当网页收到一个条新消息时,如果IE窗口不是激活状态,如何让这个IE窗口在任务栏上闪烁?就像QQ收到新消息后,会闪烁提醒用户.注意,是任务栏上的按钮,不是系统托盘.我想让任务栏上IE窗口按钮闪烁,但不想让窗口跳出来,所以用window.focus()是不可行的. 

解决方案 »

  1.   

    用jquery
    <script type="text/javascript" src="../../include/jquery/tablesorter.pager/jquery-latest.js"></script>
    <script type="text/javascript">
    $(document).ready(function()
    {
        setInterval(shine,1000);
    }
    );var shine=function()
    {
        //document.title = new Date().getTime();
        document.title = (document.title=='你有新的短消息'?'':'你有新的短消息')
    }
    </script> 
      

  2.   


    我看你是迷上jQuery啦,哈哈..
    setInterval(code,millisec[,"lang"])并不是jQuery原生提供的方法,是HTML DOM里面的方法,我把你的方法还原成JS给他吧..
    <script type="text/javascript">
    window.onload=function(){
        setInterval(shine,1000);//按1000毫秒=1秒周期调用shine()方法.
    }//闪烁提示用户有新消息
    function shine()
    {
        document.title = (document.title=='你有新的短消息'?'':'你有新的短消息')
    }
    </script>