我使用noty.js插件(http://ned.im/noty/)向用户显示状态信息。如果用户在显示时点击noty.js消息,则消息将被隐藏。
如何禁用点击隐藏功能?我只是想让消息保持显示,直到我自动隐藏它或我的程序命令来隐藏它。
谢谢。
答案 0 :(得分:5)
从文档中,以下是默认值:
$.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: []
});
然后点击它就不会关闭。
答案 1 :(得分:0)
noty({text:'Data Saved', layout: 'topRight', type: 'success',killer : true,timeout: 1000});