Customizing JBar for Notifications

Posted by Ryan Ohs on Geeks with Blogs See other posts from Geeks with Blogs or by Ryan Ohs
Published on Fri, 21 May 2010 08:34:55 GMT Indexed on 2010/05/21 15:41 UTC
Read the original article Hit count: 341

Filed under:

Lately I've been using JBar, a very neat jQuery plugin for displaying notifications in my web applications. Unfortunately the original version of JBar only supports binding to the click event of a DOM item. In order to get around this limitation I have modified the source code and posted an updated version on my GitHub account here. The modified version allows you to display a JBar notification by calling a method. I typically use it to display succes or failure messages when doing Ajax calls.

I have also included some additional CSS and JS so that you can diplay different styles of notifications.

showNotification(message) shows a green "success" message.

showWarning(message) shows an orange "warning" message.

showMessage(message, className) allows you to specify a custom class to apply to the notification for additional styling purposes.

A web page with samples is included.

 

Get the code here.

© Geeks with Blogs or respective owner