I'm using jGrowl to display messages and alerts, the datepicker I'm using is triggering the .change() function three times in short succession meaning there are three messages being displayed every time you pick a date/time, I'd like to limit this to just one.
I've tried $.jGrowl.defaults.pool = 1;
but unfortunately this just causes the messages to stack, rather than actually just displaying a single message.
Here's the code I'm using, at the moment it still displays 3 messages despite the checks in place:
if($('.jGrowl-notification').length == 0) {
jGrowl('message');
} else {
if ( $('.jGrowl-notification').not(':visible') ) {
jGrowl('message');
}
}
(the first time a message is displayed, the .jGrowl-notification div is created, then when the message times out it is hidden)
Any help would be much appreciated, thank you