如何在 jgrowl 中只粘贴一次消息?

发布于 2024-07-26 18:22:06 字数 31 浏览 5 评论 0原文

有没有一种方法可以将一条消息仅粘贴在集合中一次?

Is there a way to stick(y) a message in the collection only one time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝眼睛不忧郁 2024-08-02 18:22:06

我不明白这个问题,根据示例,如果您设置标志,当您关闭它时,它不会再次显示...

您是否有一些希望每个用户看到的全局消息池,您在每个页面上显示这些消息,但如果他隐藏则不会再次显示消息?

I don't understand the question, according to the examples, a message will be sticky if you set the flag, and when you dismiss it, it doesn't show up again...

Do you have some global pool of messages that you want each user to see, that you show on each page, but not show again if he hides the message?

征﹌骨岁月お 2024-08-02 18:22:06

正确,粘性属性将通知粘在窗口上。 如果您希望每个浏览器实例都有唯一的通知,这不是 jGrowl 的功能,您需要自己跟踪它。 您可以通过使用容器的 data 属性来完成此操作,创建一个地图并在 beforeOpen 回调中检查它,如果地图中存在则返回 false。 如果您在默认值中设置回调,它将应用于创建的所有消息。

Correct, the stick attributes sticks the notification to the window. If you want unique notifications per browser instance this is not a feature of jGrowl and you will need to track it yourself. You can do this by using the data attribute of the container, creating a map and checking it in the beforeOpen callback and returning false if it exists in your map. If you set the callback in your defaults it will apply to all messages created.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文