在AJAX调用之后,我正在使用(v3.1.5)的最新版本来显示状态消息。在第一个呼叫中,它的工作方式与预期的一样。在第一次执行之后,每次调用notifications时,它都会显示先前的通知消息。
示例:
第一呼叫=1通知消息;第二呼叫=2通知消息;第3呼叫=3通知消息;.
引导通知初始化:
$.notify({
icon: icon,
title: title,
message: message
}, {
type: type,
allow_dismiss: true,
newest_on_top: false,
placement: {
from: "top",
align: "right"
},
offset: 20,
spacing: 10,
z_index: 100000,
delay: delay,
timer: 1000,
mouse_over: true,
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
}
});我怎样才能解决这个问题?
发布于 2017-02-21 12:47:03
解决了我的问题。经过一些调试后,我意识到该事件被多次触发,从而导致通知反复弹出。很大的新秀错误..。
发布于 2020-08-28 13:27:47
您可以通过使用get所有通知长度并阻止它来防止。如果通知大于0,则返回false;
let notifylength = document.querySelectorAll('.bootstrap-notify-container');
if(notifylength.length !== 0){
return false;
}https://stackoverflow.com/questions/41922873
复制相似问题