views:

21

answers:

1

Hi

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 notifications and new ones keep poping up. I might think there is some sort of problem with the site.

Anyone know how to do this?

A: 

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); }
});
dev-null-dweller
Ya I been playing around with what you have and changed it to my needs. I think I got it working but they need something built in. Kinda sucks that every open notification has to update that line. So 5 jquery queries need to be made. Would be nice to reduce that down to one. It loads up the first X once loaded up it figure out how many are shown. not how it is now where it does that after every notification.
chobo2