• jquery 通知页面变化


    var PageTitleNotification = {
        Vars: {
            OriginalTitle: document.title,
            Interval: null,
            IsNotificationEnabled: false
        },
        On: function (notification, intervalSpeed) {
            var _this = this;
            _this.Vars.Interval = setInterval(function () {
                document.title = (_this.Vars.OriginalTitle == document.title)
                                    ? notification
                                    : _this.Vars.OriginalTitle;
            }, (intervalSpeed) ? intervalSpeed : 1000);
        },
        Off: function () {
            clearInterval(this.Vars.Interval);
            document.title = this.Vars.OriginalTitle;
        }
    }
    $(window).focus(function () {
         PageTitleNotification.IsNotificationEnabled = false;
         PageTitleNotification.Off();
    });
    
    $(window).blur(function () {
         PageTitleNotification.IsNotificationEnabled = true;
    });
    if (PageTitleNotification.IsNotificationEnabled)
        PageTitleNotification.On("New Chat Message!");
  • 相关阅读:
    poj1580
    poj1607
    poj1313
    poj1314
    c语言之extern和static
    C笔记(一)
    搭建Linux高可用性集群(第一天)
    利用回调函数实现泛型算法
    关于SQL server中的 identity
    SQL(一)
  • 原文地址:https://www.cnblogs.com/JasonLiao/p/JqueryNotifyPageActive.html
Copyright © 2020-2023  润新知