有没有办法检测是否已使用JQuery本身关闭了JQuery Noty通知?
我的主页上有Noty通知。我想检测通知何时关闭。任何人都可以帮忙吗?
Noty:
var n = noty({
layout: 'topCenter',
theme: 'relax',
type: 'information',
force: false,
text: 'This one worked',
animation: {
open: 'animated zoomIn', // Animate.css class names
close: 'animated zoomOut', // Animate.css class names
}
});
答案 0 :(得分:1)
有一种方法称为“回调”'在诺伊。这就是我用它在关闭时检测的方式:
var n = noty({
layout: 'topCenter',
theme: 'relax',
type: 'information',
force: false,
text: 'This one worked',
animation: {
open: 'animated zoomIn', // Animate.css class names
close: 'animated zoomOut', // Animate.css class names
},
callback: {
onClose: function() {
Cookies.set('ShowNoty', false);
},
},
});