【问题标题】:Pines Notify closing notice and stacksPines 通知关闭通知和堆栈
【发布时间】:2013-05-04 17:31:33
【问题描述】:

我正在尝试使用jQuery Pines Notify 1.2。

1) 在通知弹窗中有一个关闭按钮,我们可以用它来关闭通知。或者当计时器达到延迟值时,它会自动关闭。但是是否可以通过单击通知中的任何点来关闭通知?

2) 我尝试并成功运行了基本的。但我尝试了demo page 的“自定义堆栈示例”部分。但他们没有工作。例如:

show_stack_topleft('notice');

function show_stack_topleft(type) {
    var opts = {
        title: "Over Here",
        text: "Check me out. I'm in a different stack.",
        addclass: "stack-topleft",
        stack: stack_topleft
    };
    switch (type) {
    case 'error':
        opts.title = "Oh No";
        opts.text = "Watch out for that water tower!";
        opts.type = "error";
        break;
    case 'info':
        opts.title = "Breaking News";
        opts.text = "Have you met Ted?";
        opts.type = "info";
        break;
    case 'success':
        opts.title = "Good News Everyone";
        opts.text = "I've invented a device that bites shiny metal asses.";
        opts.type = "success";
        break;
    }
    $.pnotify(opts);
}

当我运行这段代码时,我得到了stack_topleft is undefined
但如果我删除 stack: stack_topleft 行,我仍然看不到左上角的通知。

【问题讨论】:

    标签: javascript jquery pnotify


    【解决方案1】:

    1) 你将不得不添加类似于: $('.ui-pnotify').click(function(){ $(this).remove(); });

    2)您必须定义 stack_topleft(在此页面上找到:https://github.com/sciactive/pnotify):

    var stack_topleft = {"dir1": "down", "dir2": "right", "push": "top"};

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多