Customizing JBar for Notifications
- by Ryan Ohs
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.