https://github.com/zhoukekestar/toast
Toast, a simple, lightweight, no-dependencies toast.
https://github.com/zhoukekestar/toast
js toast web
Last synced: over 1 year ago
JSON representation
Toast, a simple, lightweight, no-dependencies toast.
- Host: GitHub
- URL: https://github.com/zhoukekestar/toast
- Owner: zhoukekestar
- License: mit
- Created: 2017-06-06T07:35:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T08:36:05.000Z (about 9 years ago)
- Last Synced: 2025-01-20T23:48:05.224Z (over 1 year ago)
- Topics: js, toast, web
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# toast
Toast, a simple, lightweight, no-dependencies toast.
# API
## `toast(message)`
toast a message with default params.
## `toast(options)`
* `options` : `Object`
* `text` : `String` Message to toast
* `time` : `Number` The time to show toast message
* `width` : `Number` Toast width
## `toast.defaults = options`
* `options` : `Object`
* `text` : `String` Message to toast
* `time` : `Number` The time to show toast message
* `width` : `Number` Toast width
# Online Demo
* [Toast with polyfill](https://zhoukekestar.github.io/toast/test/index.html)
* [Toast on latest Chrome. Try ES6/7!](https://zhoukekestar.github.io/toast/test/chrome.html)
```js
async function () {
await toast('wait for me!');
alert('yeah!');
}
```
# Browser Compatibility
| IE 7, 8 | IE 9 | IE 10+, Chrome, Firefox ...|
| -- | -- | -- |
| No animation!  | No animation!  |  |