notiFire 0.9

--- A simple message notification library

Demos

Basic Example: notifire({ msg: 'this is a test message' });
Choose the type notifire({ msg: 'Yeah!!! Success!!!', types: 'success' });
Any size you wany notifire({ msg: 'this is a test message with width of 400px and height of 200px', types: 'info', width: 400, height: 200 });
Left or right? notifire({ msg: 'I am on the right', types: 'warning', position: 'right' });
When should I disappear? notifire({ msg: 'I will be gone in 1 second!!!', types: 'danger', timeout: 1000 });
I will not disappear notifire({ msg: 'I will not disappear', types: 'danger', timeout: false });
Whatever color you need. notifire({ msg: 'I am different than the others :)', types: 'danger', backgroundColor: 'red' });
Customize your border: notifire({ msg: 'Look! I have a border!', types: 'danger', backgroundColor: 'red' });
Customize your content color: notifire({ msg: 'Font color is up to you.', types: 'danger', backgroundColor: 'red' });
Opacity is cool! notifire({ msg: 'Opacity is cool!', types: 'info', opacity: 0.3 });
Callback notifire({ msg: 'See how callback is fired', types: 'info', callabck: function() { alert('callback is fired!'); } });

Usage

Parameters:

• msg - (string, required): the content of your message

• types - (string): choose from 'success', 'info', 'warning', 'danger' or 'default'. Each type have a different background color.

• width - (integer): width of the notificatoin message in px

• height - (integer): height of the notificatoin message in px

• color - (string): color of the text message, could be CSS default colors or hex colors

• borderStyle - (string): the border-style of the message div, should be valid border-style value

• borderWidth - (integer): border-width of the message div in px

• borderColor - (string): the border-color of the message div, could be CSS default colors or hex colors

• backgroundColor - (string): the backgroudn-color of the message div, could be CSS default colors or hex colors

• opacity - (float): the opacity value of the message div

• position - (string): 'left' or 'right'

• timeout - (integer): how long do you need to display the message, in ms. 'false' if don't need auto-disappear

• callback - (function): the callback function to trigger when clicking the message to close it.

Full Example notifire({ msg: 'See how callback is fired', types: 'info', width: 300, height: 200, color: 'white', borderStyle: 'solid', borderWidth: 1, borderColor: '#33aaee', backgroundColor: 'blue', opacity: 0.5, position: 'right', timeout: 'false', callback: function() { alert('callback after full-example has been triggered.'); } });
Developed by Dong | Get it on GitHub