JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://raw.githubusercontent.com/dotCtor/jQuery.msgBox/master/styles/msgBoxLight.css">
<button class="msg_alert">ALERT</button>
<button class="msg_cfghonfirm">CONFIRM</button>
<button class="msg_info">INFO</button>
CSS
div.msgBox
{
padding: 4px 10px 4px 10px;
position: fixed;
z-index: 10000;
font-family:Verdana;
width: 430px;
min-height:160px;
color: #00335e;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
-moz-box-shadow: 0px 0px 11px #000000;
-webkit-box-shadow: 0px 0px 11px #000000;
box-shadow: 0px 0px 11px #000000;
}
div.msgBoxBackGround
{
top:0;
left:0;
position:absolute;
padding:0;
margin:0;
width:100%;
height:100%;
background-color:#000000;
opacity:0.9;
z-index:999;
}
div.msgBoxTitle
{
padding:5px 0 5px 0;
font-variant:small-caps;
font-size:16pt;
font-weight:lighter;
color:#00335e;
width:100%;
border-bottom : 1px solid #002c5f;
}
div.msgBoxImage
{
margin:20px 5px 0 5px;
display:inline-block;
float:left;
height:75px;
width:75px;
}
div.msgBoxImage img
{
height:75px;
width:75px;
}
div.msgBoxContent
{
font-size:11pt;
margin:0 3px 6px 3px;
display:inline-block;
float:left;
height:90px;
width:319px;
overflow-y: auto;
}
div.msgBoxContent p
{
padding:0;
margin:0;
display: table;
height: 100%;
width: 100%;
}
div.msgBoxContent span
{
display: table-cell;
vertical-align: middle;
color: #00335e;
}
div.msgBoxButtons
{
display:inline-block;
width:100%;
text-align:right;
margin-bottom: 3px;
}
div.msgBoxButtons input[type='button']
{
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #F5F5F5;
background-image: linear-gradient(to bottom, #FFFFFF, #E6E6E6);
background-repeat: repeat-x;
border-color: #CCCCCC #CCCCCC #B3B3B3;
border-image: none;
border-radius: 4px 4px 4px 4px;
border-style: solid;
border-width: 1px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
...
JavaScript
var msgBoxImagePath = "http://d2mdw063ttlqtq.cloudfront.net/files/3402416/javascript/msgbox/images/";
jQuery.msgBox = msg;
function msg (options) {
var isShown = false;
var typeOfValue = typeof options;
var defaults = {
content: (typeOfValue == "string" ? options : "Message"),
title: "Warning",
type: "alert",
autoClose: false,
timeOut: 0,
showButtons: true,
buttons: [{ value: "OK"}],
inputs: [{ type: "text", name:"userName", header: "User Name" }, { type: "password",name:"password", header: "Password"}],
success: function (result) { },
beforeShow: function () { },
afterShow: function () { },
beforeClose: function () { },
afterClose: function () { },
opacity: 0.1
};
options = typeOfValue == "string" ? defaults : options;
if (options.type != null) {
switch (options.type) {
case "alert":
options.title = options.title == null ? "Warning" : options.title;
break;
case "info":
options.title = options.title == null ? "Information" : options.title;
break;
case "error":
options.title = options.title == null ? "Error" : options.title;
break;
case "confirm":
options.title = options.title == null ? "Confirmation" : options.title;
options.buttons = options.buttons == null ? [{ value: "Yes" }, { value: "No" }, { value: "Cancel"}] : options.buttons;
break;
case "prompt":
options.title = options.title == null ? "Log In" : options.title;
options.buttons = options.buttons == null ? [{ value: "Login" }, { value: "Cancel"}] : options.buttons;
break;
default:
image = "alert.png";
}
}
options.timeOut = options.timeOut == null ? (options.content == null...