如何在 jgrowl 中只粘贴一次消息?
有没有一种方法可以将一条消息仅粘贴在集合中一次?
Is there a way to stick(y) a message in the collection only one time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有没有一种方法可以将一条消息仅粘贴在集合中一次?
Is there a way to stick(y) a message in the collection only one time?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我不明白这个问题,根据示例,如果您设置标志,当您关闭它时,它不会再次显示...
您是否有一些希望每个用户看到的全局消息池,您在每个页面上显示这些消息,但如果他隐藏则不会再次显示消息?
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?
正确,粘性属性将通知粘在窗口上。 如果您希望每个浏览器实例都有唯一的通知,这不是 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.