jNotify: Disply animated boxes (informations, errors, success) in just one line of code

jNotify can display information boxes in just one line of code.

Three kind of boxes are allowed : information, success and failure.

The whole box is entirely skinnable with css. For example, you could use it for a mail being successfully sent or a validation error of a form.

Download: https://github.com/Delzon/jNotify

Demonstration:

Plugin homepage:

Implementation:

1. First, include the css & jquery files

<!-- include CSS & JS files -->
<!-- CSS file -->
<link rel="stylesheet" type="text/css" href="jNotify.jquery.css" media="screen" />
 
<!-- jQuery files -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jNotify.jquery.js"></script>

2. Now, call one of the jNotify methods

<script type="text/javascript">
  $(document).ready(function(){
  // simple Notify box call
  jNotify();
 
  // simple Error box call
  jError();
 
  // simple Success box call
  jSuccess();
 
  // more complex Notify box call
  jNotify(
    'Here the message !!<br />You can write HTML code, <strong>bold</strong>,...',
    {
      autoHide : true, // added in v2.0
      TimeShown : 3000,
      HorizontalPosition : 'center',
      onCompleted : function(){ // added in v2.0
      alert('jNofity is completed !');
    }
  }
  ); // close jNotify
}); // close document.ready
</script>

Options:

autoHideBooleanDefault : true – jNotify closed after TimeShown ms or by clicking on it
clickOverlayBooleanDefault : false – If false, disables closing jNotify by clicking on the background overlay.
MinWidthIntegerDefault : 200 – In pixel, the min-width css property of the boxes.
TimeShownIntegerDefault : 1500 – In ms, time of the boxes appearances.
ShowTimeEffectIntegerDefault : 200 – In ms, duration of the Show effect
HideTimeEffectIntegerDefault : 200 – In ms, duration of the Hide effect
LongTripIntegerDefault : 15 – Length of the move effect (‘top’ and ‘bottom’ verticals positions only)
HorizontalPositionStringDefault : right – Horizontal position. Can be set to ‘left’, ‘center’, ‘right’
VerticalPositionStringDefault : top – Vertical position. Can be set to ‘top’, ‘center’, ‘bottom’.
ShowOverlayBooleanDefault : true – If true, a background overlay appears behind the jNotify boxes
ColorOverlayStringDefault : #000 – Color of the overlay background (only Hex. color code)
OpacityOverlayIntegerDefault : 0.3 – Opacity CSS property of the overlay background. From 0 to 1 max.

Methods:

onCompletedFunctionReturns : null – Callback that fires right after jNotify content is displayed.
onClosedFunctionReturns : null – Callback that fires once jNotify is closed

Screenshots:

Creating a JavaScript Library

I recently wrote a JavaScript library for creating random colors and color schemes, and while I foun…

jQuery Flash Plugin

This jQuery plugin is for embedding Flash movies. Pages are progressively enhanced when Flash and Ja…

jQuery Optimization: Optimize Selector

We can also optimize our selector other than being a bit specific on our selector. The key to optimi…

jQuery drop down menu: droppy

Quick and dirty nested drop-down menu in the jQuery style. I needed a nav like this for a recent pro…

jQuery slideViewerPro: A “pro” jQuery image slider

slideViewerPro is a fully customizable jQuery image gallery engine which allows to create outstandin…

jQuery Optimization: Avoid Unnecessary Styling

This is another common mistake that many jQuery developer made. jQuery provides us with the ability …