Reputation: 2251
Is there a way to detect if a JQuery Noty notification has been closed using JQuery itself?
I have a Noty notification on my homepage. I would like to detect when the notification has been closed. Can anyone help with this?
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
}
});
Upvotes: 0
Views: 587
Reputation: 2251
There is a method called 'callback' in Noty. This is how I used it to detect on close:
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);
},
},
});
Upvotes: 1