2014-07-01 95 views
3

我正在使用noty.js插件(http://ned.im/noty/)向用戶顯示狀態信息。如果用戶在顯示時點擊noty.js消息,該消息將被隱藏。jquery noty.js禁用點擊隱藏

如何禁用點擊隱藏功能?我只想讓消息保持顯示直到我自動隱藏它或我的程序命令隱藏它。

謝謝。

回答

4

從文檔,這裏是默認值:

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

然後,它不會關閉時你點擊它。

+0

「回調」幫助了我。謝謝安託萬 –