tb.essage

a more elegant way to show message


Keywords
message
License
Other
Install
bower install tb.essage

Documentation

Essage

a more elegant way to show message / tips.



72913732-3232-49d1-ac6b-cfcc8035cefd


1. installaion

Place the js/css file on you page, and use the Essage object to manage your message:

<link rel="stylesheet" href="essage.css">
<script src="essage.js"></script>

2. API: show or hide

show(message) show message

 // The argument `message` can be html(string).
 Essage.show('<b>hello</b>, im a message.');

hide() hide message

 Essage.hide();

config: provide configurations

 var config = {
   message: 'message body',

   // add class `essage-success` to the container
   // by default, there're 4 status: normal, warning, success, error
   status: 'success',

   // the placement can be `top` or `bottom`, by default is `top`
   placement: 'bottom'

   // duration in ms
   // provide _negative_ number to always show if default duration is set
   duration: 1000
 };

 Essage.show(config);

default() set default duration

 Essage.default({duration: 3000});
 Essage.show('message');

3. MIT licence

Licensed under MIT. liccese.txt