https://github.com/jadjoubran/android-toast
An HTML5 replication of the Native Android Toast http://developer.android.com/guide/topics/ui/notifiers/toasts.html
https://github.com/jadjoubran/android-toast
Last synced: 6 months ago
JSON representation
An HTML5 replication of the Native Android Toast http://developer.android.com/guide/topics/ui/notifiers/toasts.html
- Host: GitHub
- URL: https://github.com/jadjoubran/android-toast
- Owner: jadjoubran
- License: other
- Created: 2013-06-10T07:16:27.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-08-10T16:02:14.000Z (about 9 years ago)
- Last Synced: 2025-04-12T00:32:34.742Z (6 months ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 35
- Watchers: 6
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
# Android-Toast
An HTML5 replication of the Native Android Toast http://developer.android.com/guide/topics/ui/notifiers/toasts.html
Demo: http://jadjoubran.github.io/Android-Toast/
Compatible with PhoneGap applications.
To use Android toast, simply include src/css/toast.css and src/js/toast.js to your project and call the android_toast javascript function (does not require jQuery or any external DOM manipulation library)
var toast1 = new Android_Toast({content: 'Please check your connection and try again.'});
You can also customize the position and the duration:
var toast2 = new Android_Toast({content: 'Connected to Wi-Fi network <em>Router Name</em>', duration: 4000, position: 'top'});
## Installation
Package is available through bower:
bower install android-toast
Or you can simply include the `dist/android_toast.min.js` and `dist/android_toast.min.css` files in your document.
## JavaScript API
The constructor function accepts 3 options:
**content** sets the text to be displayed. `` text will be highlighted in blue.
**duration** accepts an integer. The toast will disappear after the set duration. Defaults to 3000 (milliseconds).
**position** Either `top` or `bottom`. Determines the position of the toast. Defaults to `bottom`.
## License
Check the MIT-LICENSE.txt file
## Contributors
http://www.eTobb.com 's first Open Source contribution.
Developed by Jad Joubran [@JoubranJad](https://twitter.com/joubranjad)
Other contributors:
[Patsy Issa](https://github.com/Patsy-issa)