在显示新通知之前关闭之前的 jGrowl 通知
我有一个执行 $.jGrowl("loading");
的简单应用程序。然后,在处理数据后显示数据 $.jGrowl("blah blah blah data gone here");
,这可能需要 1 -5 秒。
我看过一个 帖子 提到使用 default.pool 一次只显示一条消息。我想要的格式是:
- 显示框1
- 紧缩数据
- 关闭框1
- 显示框2
是否有一个jGrowl 功能可以启动以关闭所有通知?
更新
根据源示例,您可以执行以下操作$('#loading').jGrowl('');
然后调用关闭它$('#loading').jGrowl('shutdown');
这确实隐藏了加载咆哮,但它也隐藏了该区域的后续通知。
I have a simple app that executes $.jGrowl("loading");
. Then the data is displayed $.jGrowl("blah blah blah data goes here");
after crunching data which can take 1 -5 seconds.
I've seen a post that mentions using the default.pool to only display one message at a time. The format I want is:
- Show box 1
- crunch data
- close box 1
- show box 2
Is there a jGrowl function that can be initiated to close all notifications?
UPDATE
according to the source example you can do the folowing$('#loading').jGrowl('<img src="images/loading.gif" alt="Loading..." />');
then call to close it$('#loading').jGrowl('shutdown');
<div id="loading" class="top-right"></div>
that does hide the loading growl, however it also hide subsequent notifications in that region.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
上面的第3行在加载内容后隐藏了loadinggrowl div。
这可能不是最好的方法,但它确实有效。
Line 3 above hides the loadinggrowl div after loading the content.
this may not be the best way, but it works.
您可以使用
$(".jGrowl-notification").each
查找所有通知,使用.trigger('jGrowl.beforeClose')
触发关闭功能,然后创建您的通知新的咆哮声,如下所示:You can find all notification with
$(".jGrowl-notification").each
, trigger the close fonction with.trigger('jGrowl.beforeClose')
, and create your new growl, like below :