https://github.com/sofish/essage
a more elegant way to show message
https://github.com/sofish/essage
Last synced: over 1 year ago
JSON representation
a more elegant way to show message
- Host: GitHub
- URL: https://github.com/sofish/essage
- Owner: sofish
- License: other
- Created: 2013-09-27T14:06:44.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-09-29T03:30:04.000Z (almost 13 years ago)
- Last Synced: 2025-03-28T18:11:29.882Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://sofish.github.io/essage/
- Size: 175 KB
- Stars: 186
- Watchers: 9
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# Essage
> a more elegant way to show message / tips.
-------------------------
- Live demo [http://sofish.github.io/essage/](http://sofish.github.io/essage/)
- Browser support: tested under IE6+, Firefox, Chrome, Safari, Mobile Safari
- Light, Elegant, No hard dependency
-------------------------

-------------------------
### 1. installaion
Place the js/css file on you page, and use the `Essage` object to manage your message:
```html
```
### 2. API: `show` or `hide`
1. **show(message, timeout)** show message
```js
// The argument `message` can be html(string).
Essage.show('hello, im a message.');
```
**auto hide**: If `timeout` {Number} is specific, the message will hide automaticlly after `timeout` (ms).
```js
// `timeout` should be a number
Essage.show('i willl hide automaticlly after 2 seconds', 2000);
```
**config**: And, the `message` can be an object:
```js
var message = {
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'
};
Essage.show(message, 3000);
```
2. **hide()** hide message
```js
Essage.hide();
```
### 3. MIT licence
Licensed under MIT. [liccese.txt](https://github.com/sofish/essage/blob/master/license.txt)