Feb 102014
Simple Notifications jQuery

Today  I will explain how to implement Simple Client Side Notifications using jQuery.

There are so many jQuery notifications plugins are available for implementing client side notifications , But recently I came across a beautiful plug in called ‘Toastr‘ , a CodeSeven jQuery plugin which is very simple to use and can be easily customized and extended.

Let’s go through a simple example. As I told before it’s very easy to use.

Link to toastr.css and toastr.js files.


We can trigger four types of notifications

  • Success
  • Error
  • Warning
  • Info

To Display Simple Notifications without Title use toastr.info() or toastr.error() or toastr.success() or toastr.warning()


To Add Title to the notification pass Title as second argument.


Here is the simple Demo.

Simple jQuery Notifications

Simple jQuery Notifications

Not only simple text you can  write html tags as notification dialogue box body. Here is the simple example.


Enable Close Button in Toastr jQuery Notification plug in:

By default close button is disabled in this jQuery notification plug in and You can enable this by setting “closeButton” value to true.


This will enable close button icon in notification dialogue box as shown in above figure. And if you want to override this closeButton use the below code.


And if you want to close all notifications at a time use the tostr.clear() function.

Position of jQuery Notifications in Web page:

Default position of notifications is “top right”.You can change the position of notification using “positionClass” attribute. With this options we can display notifications in six different positions in a Web page.


Display Sequence of Multiple Notifications:

If you have multiple notifications, newest notification are shown at top side by default .However you can disable this options by setting “newestOnTop” to false. Then newest notification are shown at bottom side.


Here I covered basic usage of this beautiful jQuery notification plug in “Toastr”.It comes with so many options like callback mechanisms , Animations etc and you can override the CSS file to change the display . Please go through the plugin site to explore these options.

Here is the Simple Demo

Toastr is Responsive:

Include the viewport meta tag and the “toastr.css”, and toastr will adjust to different device sizes.You can test responsiveness of this plug in here “Toastr plug in Notification Responsiveness

I hope you have enjoyed this article.If so share this post with your friends and also join our mailing list.Wait before leaving. why can’t you follow me on twitter or be a friend on Facebook  or googlePlus to get in touch me.

Optimization WordPress Plugins & Solutions by W3 EDGE
268 Flares Twitter 0 Facebook 0 Google+ 256 LinkedIn 6 StumbleUpon 0 Reddit 6 268 Flares ×