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:

How to Make Sticky Sidebar Using jQuery and CSS

Sticky sidebar is an essential part of web development. Not in all cases but for some cases where ou…

Selectors, Animation, and AJAX – jQuery Tutorial And Examples

By now I’m sure you have grasped at least the basics and simplicity of the jQuery library. Now it’s …

s3Slider jQuery Plugin & Tutorial

The s3Slider jQuery plugin is made by example of jd`s smooth slide show script. Usage: HTML: Sample …

jQuery Optimization: Avoid Unnecessary Selector

Common subexpression elimination is a common way to optimize any programming code. Doing unnecessary…

Fading Links Using jQuery: dwFadingLinks

Earlier this month, we posted a MooTools script that faded links to and from a color during the mous…

jQuery Flash Plugin

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