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.
-
let msg = new MessageBox("#id", option)
-
-
Time before the message box closes (In milliseconds). 0 to make it persistent
-
To hide the close button
-
-
-
The message that will appear on the message box
-
The label of the close button (default is "CLOSE")
-
Callback function
-