$(function ($) {
window.msgalert = (function () {
var $aol = $('<div id="alertOveryLayer" style="position: fixed; left: 0px; top: 0px; z-index: 99999; text-align: center; bottom: 0px; right: 0px; background-color: rgba(0, 0, 0, 0.298039);"><div style=" position: absolute;display: -moz-box; display: -webkit-box; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: -ms-flex; display: flex;top: 30%;width: 100%;"><div class="alert-lay" style="/* display: table-cell; */vertical-align: middle;padding: 0 10%;-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: block; -webkit-box-flex: 1; -moz-box-flex: 1; -webkit-flex: 1 1 0; -moz-flex: 1 1 0; -ms-flex: 1 1 0; flex: 1 1 0; text-align: center;"><div class="overlay-bd" style="background-color: #fff;font-size: 14px;color: #333333;line-height: 24px;padding: 20px 15px;text-align: center;border-radius: 7px 7px 0 0;"></div><div class="overlay-foot" style="border-top: 1px solid #e3e3e3;"><div class="overlay-btn overlay-btn-ok" style="background-color: #fff;cursor: pointer;font-size: 16px;color: #00a1ff;height: 42px;line-height: 42px;border-radius: 0 0 7px 7px;">我知道了</div></div></div></div></div>');
var cb = null;
var sid;
$aol.appendTo(top.document.body);
$aol.hide();
$aol.find(".overlay-btn-ok").click(function () {
$aol.hide();
typeof cb == 'function' && cb();
cb = null;
clearInterval(sid);
});
return function (msg, cbk) {
$aol.find(".overlay-bd").html(msg);
$aol.show();
cb = cbk;
//if(/iphone|ipad|ipod/i.test(navigator.userAgent)){
sid = setInterval(function () {
document.body.scrollIntoView();
}, 50);
};
})();
window.msgconfirm = function (msg, cbk_ok, cbk_no) {
var _this = this;
this.$aol = $('<div id="alertOveryLayer" style="position: fixed; left: 0px; top: 0px; z-index: 99999; text-align: center; bottom: 0px; right: 0px; background-color: rgba(0, 0, 0, 0.298039);"> <div style=" position: absolute;display: -moz-box; display: -webkit-box; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: -ms-flex; display: flex;top: 30%;width: 100%;"> <div class="alert-lay" style="/* display: table-cell; */vertical-align: middle;padding: 0 10%;-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; display: block; -webkit-box-flex: 1; -moz-box-flex: 1; -webkit-flex: 1 1 0; -moz-flex: 1 1 0; -ms-flex: 1 1 0; flex: 1 1 0; text-align: center;"> <div class="overlay-bd" style="background-color: #fff;font-size: 14px;color: #333333;line-height: 24px;padding: 20px 15px;text-align: center;border-radius: 7px 7px 0 0;"> </div> <div class="overlay-foot" style="border-top: 1px solid #e3e3e3;"> <div class="overlay-btn overlay-btn-ok" style="background-color: #fff;cursor: pointer;font-size: 16px;color: #00a1ff;height: 42px;line-height: 42px;border-radius: 0 0 0 7px;width: 50%;float: left;border-right:solid 1px #ddd; ">确定 </div> <div class="overlay-btn overlay-btn-no" style="background-color: #fff;cursor: pointer;font-size: 16px;color: #00a1ff;height: 42px;line-height: 42px;border-radius: 0 0 7px 0;width:50%;float:left;">取消</div> </div> </div> </div> </div>');
this.$aol.appendTo(top.document.body);
this.$aol.find(".overlay-bd").html(msg);
this.$aol.show();
this.cb_ok = cbk_ok;
this.cb_no = cbk_no;
//if(/iphone|ipad|ipod/i.test(navigator.userAgent)){
this.sid = setInterval(function () {
document.body.scrollIntoView();
}, 50);
this.$aol.find(".overlay-btn-ok").click(function () {
_this.$aol.hide();
typeof _this.cb_ok == 'function' && _this.cb_ok();
_this.cb_ok = null;
clearInterval(_this.sid);
});
_this.$aol.find(".overlay-btn-no").click(function () {
_this.$aol.hide();
typeof _this.cb_no == 'function' && _this.cb_no();
_this.cb_no = null;
clearInterval(_this.sid);
});
};
});