https://github.com/takaneichinose/message-box
This Message Box implementation in Javascript, inspired by material design's toast message
https://github.com/takaneichinose/message-box
alert alert-messages alertdialog alerts class css css3 dialog html html5 javascript javascript-es6 js message messagebox responsive responsive-design toast toast-message toast-ui
Last synced: about 2 months ago
JSON representation
This Message Box implementation in Javascript, inspired by material design's toast message
- Host: GitHub
- URL: https://github.com/takaneichinose/message-box
- Owner: takaneichinose
- License: mit
- Created: 2020-07-16T00:16:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T00:56:57.000Z (almost 6 years ago)
- Last Synced: 2025-04-09T11:33:37.376Z (about 1 year ago)
- Topics: alert, alert-messages, alertdialog, alerts, class, css, css3, dialog, html, html5, javascript, javascript-es6, js, message, messagebox, responsive, responsive-design, toast, toast-message, toast-ui
- Language: HTML
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Responsive Message Box
This Message Box implementation in Javascript, inspired by material design's toast message.
Note: I used the VanillaJS (native Javascript) Class to implement the message box. This may not work on older browsers, due to compatibility issue with native class.
This is resolvable by using Javascript compilers or pre-processesors, to compile the Javascript code into cross-browser Javascript code.
Usage
-
Create MessageBox class instance
let msg = new MessageBox("#id", option)
-
Available options (type: Object)
-
closeTime
Time before the message box closes (In milliseconds). 0 to make it persistent
-
hideCloseButton
To hide the close button
-
Call the "show" method to show the dialog box
Parameters
-
message
The message that will appear on the message box
-
label
The label of the close button (default is "CLOSE")
-
callback
Callback function