An open API service indexing awesome lists of open source software.

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

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

-------------------------

![72913732-3232-49d1-ac6b-cfcc8035cefd](https://f.cloud.github.com/assets/153183/1231987/9daee03c-287f-11e3-97e1-f8a66d425814.png)

-------------------------

### 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)