jQuery growl notification plugin

jQuery growl notification plugin

Posted on March 21, 2010 by Ashley

Last week I signed up Gravity a new site setup by a few guys that used to work at MySpace. As i was using the site I noticed these great little notifications popping up in my browser, Mac users will be familiar with this as they work in the same way as Growl notifications.
I thought it was interesting that this technique of displaying live information to users could be presented in this way, so i went on the hunt for a similar jQuery plugin and found a number of results however the one that caught my eye was the jQuery Notice plugin by Tim Benniks.

The JavaScript

Below is the JavaScript that is used in the demo this plugin simply extends the jQuery framework, allowing you to activate a message box by calling the function ‘noticeAdd()’.

One interesting feature of this plugin is that it allows you to append a CSS class to the popup notice which can then be styled.

For example with the error message I’m appending the .error class and in the CSS i’m just adding a background color.


	$(document).ready(function()
	{
			jQuery.noticeAdd({
				text: 'This is a simple notification using the jQuery notice plugin. Click the X above to remove this notice.',
				stay: true
			});

		$('.add').click(function()
		{
			jQuery.noticeAdd({
				text: 'This is a notification that you have to remove',
				stay: true
			});
		});

		$('.add2').click(function()
		{
			jQuery.noticeAdd({
				text: 'This is a notification that will remove itself',
				stay: false
			});
		});

			$('.add3').click(function()
		{
			jQuery.noticeAdd({
				text: 'This is an error notification!',
				stay: false,
				type: 'error'
			});
		});

					$('.add4').click(function()
		{
			jQuery.noticeAdd({
				text: 'This is a success notification!',
				stay: false,
				type: 'success'
			});
		});

		$('.remove').click(function()
		{
			jQuery.noticeRemove($('.notice-item-wrapper'), 400);
		});
	});

The HTML

<ul>
  <li class="add">Click here to see a notification that you have to remove</li>
  <li class="add2">Click here to see a notification that does not stay</li>
  <li class="add3">Error Notification</li>
  <li class="add4">Success Notification</li>
  <li class="remove">Remove all active notifications</li>
</ul>

This entry was posted in CSS, Design, Downloads, Javascript, jQuery and tagged , , , , , , , . Bookmark the permalink.
Comments
9 discussions around jQuery growl notification plugin
  1. Pingback: uberVU - social comments

  2. Paweł P. says:

    Nice plugin! I’ll use this solution in next project.
    Best regards! Take care!

  3. thanks it’s very useble…

  4. Sashi says:

    Very nice plugin…. dynamic !

  5. Tim Benniks says:

    Hey Ashley,
    Thanks for featuring my jQuery plugin! I put this post on my blog too.
    http://www.timbenniks.nl/blog/964/jquery-notice-featured-on-papermashup-com

    Cheers,
    Tim

  6. Ashley says:

    Hey Tim, It’s an awesome plugin! Im currently using it in a project i’ll ping you a link when its done :)

  7. Deals says:

    Very nice plugin, I will try it on my site~

  8. This notifications will be great on wordpress.

    Exaple:

    Show a notification bubble to unregistered users.

    And not to show that bubble when your logged in.

    I dont know if you ccan do that.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribers
1,250
Twitter
510
Comments
1,207
Posts
125