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);
        }
    }
  • 相关阅读:
    Ajax请求过程中显示“进度”的简单实现
    Asp.net 图片文件防盗链介绍
    ASP.NET MVC验证
    MVC文件上传
    MVC文件上传-使用jQuery.FileUpload和Backload组件实现文件上传
    使用jQuery.FileUpload插件和服Backload组件自定义上传文件夹
    使用jQuery.FileUpload和Backload自定义控制器上传多个文件
    使用jQuery.FileUpload插件和Backload组件裁剪上传图片
    CSS3 多列
    CSS3 2D转换 动画
  • 原文地址:https://www.cnblogs.com/cryst/p/6029150.html
Copyright © 2011-2022 走看看