Jquery noty.js禁用点击隐藏



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

如何禁用点击隐藏功能?我只是希望消息保持显示,直到我自动隐藏它或我的程序命令隐藏它。

谢谢。

文档中的默认值如下:

$.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: []
});

当你点击它时它不会关闭

noty({text:'Data Saved', layout: 'topRight', type: 'success',killer : true,timeout: 1000});

相关内容

  • 没有找到相关文章

最新更新