gpt4 book ai didi

jquery - 当特定通知出现时关闭所有 pnotify 通知

转载 作者:行者123 更新时间:2023-12-01 06:14:23 25 4
gpt4 key购买 nike

我正在使用 pnotify 插件。我的代码如下:

$('.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
});
}
});

我的问题是,当此通知出现在 .input_elements 更改事件上时,如何使页面上的所有其他可见通知消失。 pnotify 上是否有一个选项可以使其在打开另一个选项时消失?

最佳答案

您可以使用 PNotify.removeAll() 删除所有通知。

关于jquery - 当特定通知出现时关闭所有 pnotify 通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23921749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com