I am using pnotify plugin. My code is as follows:
$('.input_elements').on('change', function() {
if ($(this).val() > 2) {
$.pnotify({
text: 'Quantity exceeds the number of available items.',
type: 'error',
delay: 2500,
history: false,
sticker: true
});
} else {
$.pnotify({
text: 'Saved.',
type: 'success',
delay: 2500,
history: false,
sticker: true
});
}
});
My question is, how can I make all other visible notifications on page go away when this notification shows up on .input_elements
change event. Is there an option on pnotify that makes it go away if another is opened?
You can use PNotify.removeAll() to remove all the notifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With