A simple but flexible notification plugin with the minimum required functionalities.
Current version: 1.0 Stable
Demonstration
-
Default
Show usageclick meHello, I am a simple notification.
-
Close button
Show usageclick meHello, I am a notification with a close button.
Basic Usage
Basic HTML
<div id="notification">
<p>The notification has been successfully displayed</p>
</div>
Basic CSS
#notification {
display: none;
position: fixed;
cursor: pointer;
width: 100%;
background: #EFEFEF;
text-align: center;
border-top: 2px solid #FFF;
z-index:9999;
}
Basic Initialization
$(function() {
$('#notification').miniNotification();
});
Options
-
position (string)
Notification position. Possible values: 'top' or 'bottom'.
Default value is 'top' Show example -
show (boolean)
Show on load.
Default value is true Show example -
effect (string)
Animation effect. Possible values: 'slide' or 'fade'.
Default value is 'slide' Show example -
opacity (float)
Notification opacity.
Default value is 0.95 Show example -
time (integer)
Animation time in milliseconds.
Default value is 4000 Show example -
showSpeed (integer)
Show animation duration in milliseconds.
Default value is 600 Show example -
hideSpeed (integer)
Hide animation duration in milliseconds.
Default value is 450 Show example -
showEasing (string)
Easing equation on load.
Default value is an empty string Show example -
hideEasing (string)
Easing equation on load.
Default value is an empty string Show example -
innerDivClass (string)
Inner wrapper element CSS class.
Default value is 'inner' Show example -
closeButton (boolean)
Generates the close button.
Default value is false Show example -
closeButtonText (string)
Close button text content.
Default value is 'close' Show example -
closeButtonClass (string)
Close button css class name.
Default value is 'close' Show example -
hideOnClick (boolean)
Close notification on click event.
Default value is false Show example -
onLoad (function)
Called when the notification is being loaded.
Default value is empty Show example -
onVisible (function)
Called when the notification is loaded.
Default value is empty Show example -
onHide (function)
Called when the notification is hiding.
Default value is empty Show example -
onHidden (function)
Called when the notification is hidden.
Default value is empty Show example
Connect
About
Matthieu Aussaguel
I am a Web Developer currently working at Envato as part of the Marketplace dev team in Melbourne, Australia. I focus mostly on Ruby/Rails technologies but I also enjoy coding in CoffeeScript in my spare time. Head over to my personal website and my Github page for more info about me.
Follow @mattaussaguel