javascript - 如何在新的 toastr 出现时隐藏通知

标签 javascript toastr

我的应用程序中弹出通知,我希望在新通知出现时隐藏旧通知(我不希望同时显示两个通知)。

如何使用 toastr 获得这种效果?

最佳答案

您可以使用 clear 函数:

toastr.clear();

希望对您有所帮助。

来源: officiel documentation .

关于javascript - 如何在新的 toastr 出现时隐藏通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41002273/

相关文章:

javascript - 通过 html 表单提交自定义标题

javascript - 如何在保持内部 HTML 不变的情况下使用 javascript 修改字符串中每个单词的首字母?

javascript - 打开弹出窗口并在用户单击弹出窗口外的任何位置时将其隐藏

javascript - react : App not rendering to screen when wrapped in React. 组件

javascript - JSON 将数据从 HTML 发送到 PHP 并提醒用户该过程是否成功

javascript - ASP.NET MVC 4 中的 Toast 通知

javascript - 使用 Javascript/语音识别/tampermonkey 单击按钮

javascript - 使用 toastr 获取 'Cannot read property ' 然后“未定义”

javascript - 使用关闭按钮关闭 toastr 时阻止事件。

angular - ngx-toastr,Toast 未在 Angular 7 中显示