js 实现网站来消息网站标题闪动提示 .

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>

    <script>

        var g_blinkid = 0;
        var g_blinkswitch = 0;
        var g_blinktitle = document.title;
        var g_onlineuser = "";
        var g_sysmsg_sound = null;
        var g_newmsg_sound = null;
        var g_app_num = 0;
        var g_appnum = 0;
        var g_bappmore = false;
        var g_inputtime = 0;
        function blinkNewMsg() {

            document.title = g_blinkswitch % 2 == 0 ? "【   】 - " + g_blinktitle : "【新消息】 - " + g_blinktitle;
            g_blinkswitch++;

 

        }

        g_blinkid = setInterval(blinkNewMsg, 1000);

        function stopBlinkNewMsg() {

            if (g_blinkid) {
                clearInterval(g_blinkid);
                g_blinkid = 0;
                document.title = g_blinktitle;
            }
        } 
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input id="Button1" type="button" value="button" onclick="stopBlinkNewMsg();" />
    </div>
    </form>
</body>
</html>

posted @ 2012-04-01 13:05  你妹的sb  阅读(365)  评论(0编辑  收藏  举报
百度一下