zoukankan      html  css  js  c++  java
  • 结合Pnotify插件--app-jquery-notify.js

    $.NOTIFY =
    {
        showSuccess : function (title, text, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : 'success',
                hide : true,
                delay : 1500
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt);
        },
        showNotice : function (title, text, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : 'notice',
                hide : true,
                delay : 1500
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt);
        },
        showError : function (title, text, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : 'error',
                hide : true,
                delay : 1500
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt);
        },
        showLogin : function (context)
        {
            var opt =
            {
                title : "信息",
                text : "您可能已经离线,请重新刷新网页后再试!",
                type : "info",
                confirm :
                {
                    confirm : true,
                    buttons : [
                        {
                            text : '刷新网页',
                            click : function (notice)
                            {
                                top.location.reload ();
                            }
                        }
                    ]
                },
                buttons :
                {
                    closer : false,
                    sticker : false
                }
            };
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            new PNotify (opt)
        },
        showConfirm : function (title, text, buttons, context)
        {
            var opt =
            {
                title : title,
                text : text,
                type : "notice",
                confirm :
                {
                    confirm : true,
                    buttons : buttons
                },
                buttons :
                {
                    closer : false,
                    sticker : false
                }
            };
            
            if (context != undefined && context != null)
            {
                $.NOTIFY.show_context (context, false, opt);
                return;
            }
            
            new PNotify (opt);
            
        },
        show_context : function (context, modal, opt)
        {
            var opts = $.extend (
            {
                "push" : "top",
                "dir1" : "down",
                "dir2" : "left",
                "context" : context,
                "modal" : modal,
                "overlay_close" : true,
                "addclass" : "stack-modal"
            }, opt)
            new PNotify (opts);
        }
    }
  • 相关阅读:
    流水线操作verilog
    16x16移位相加乘法器verilog实现
    Nios II对flash进行读写(DE2)
    initial使用的要点
    边沿检测电路设计verilog
    DDoS攻防战 (四):CC攻击防御系统部署
    DDoS攻防战(三):ip黑白名单防火墙frdev的原理与实现
    DDoS攻防战 (二) :CC攻击工具实现与防御理论
    DDoS攻防战 (一) : 概述
    IP流量重放与pcap文件格式解析
  • 原文地址:https://www.cnblogs.com/cryst/p/6029150.html
Copyright © 2011-2022 走看看