I am using a pool of 5 with jquery. So only 5 notifications should be shown. I think it would be nice to have maybe under the "close all" button to have a count like shown 5 of 20 notifications.
To me it could get confusing if I keep closing notificat开发者_StackOverflow中文版ions and new ones keep poping up. I might think there is some sort of problem with the site.
Anyone know how to do this?
You can store number of open notifications in global variable and increase/decrease/display it by custom function called in jgrowl events: beforeOpen
/open
and beforeClose
/close
ie:
var opened = 0;
function counter(i)
{
opened += i;
$('#closeAllContainer span.counter').text(opened);
}
$.jGrowl("Lorem Ipsum", {
beforeClose: function(){ counter(-1); },
beforeOpen: function(){ counter(1); }
});
精彩评论