【问题标题】:jquery noty.js disable click to hidejquery noty.js 禁用点击隐藏
【发布时间】:2014-07-01 02:31:16
【问题描述】:

我正在使用 noty.js 插件 (http://ned.im/noty/) 向用户显示状态信息。如果用户在显示时单击 noty.js 消息,该消息将被隐藏。

如何禁用点击隐藏功能?我只想让消息一直显示,直到我自动隐藏它或我的程序命令隐藏它。

谢谢。

【问题讨论】:

    标签: jquery noty


    【解决方案1】:

    来自文档,以下是默认值:

    $.noty.defaults = {
        layout: 'top',
        theme: 'defaultTheme',
        type: 'alert',
        text: '', // can be html or string
        dismissQueue: true, // If you want to use queue feature set this true
        template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
        animation: {
            open: {height: 'toggle'},
            close: {height: 'toggle'},
            easing: 'swing',
            speed: 500 // opening & closing animation speed
        },
        timeout: false, // delay for closing event. Set false for sticky notifications
        force: false, // adds notification to the beginning of queue when set to true
        modal: false,
        maxVisible: 5, // you can set max visible notification for dismissQueue true option,
        killer: false, // for close all notifications before show
        closeWith: ['click'], // ['click', 'button', 'hover']
        callback: {
            onShow: function() {},
            afterShow: function() {},
            onClose: function() {},
            afterClose: function() {}
        },
        buttons: false // an array of buttons
    };
    

    注意这个属性:

    closeWith: ['click'], // ['click', 'button', 'hover']
    

    如果你打电话:

    noty({
      ...
      closeWith: []
    });
    

    然后点击它就不会关闭了。

    【讨论】:

    • “回调”帮助了我。谢谢安托万
    【解决方案2】:
    noty({text:'Data Saved', layout: 'topRight', type: 'success',killer : true,timeout: 1000});
    

    【讨论】:

      猜你喜欢
      • 2017-02-28
      • 2010-11-08
      • 1970-01-01
      • 2014-06-09
      • 2011-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多