Song.Site/Manage/CoreScripts/MessageBox.js
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*!
* 主 题:《消息窗口手机版》
* 说 明:用于子页面弹出时的窗口。
* 功能描述:
* 1、生成弹出消息,包括确认,提示,警告,预载;
* 2、窗口弹出时,生成背景遮罩;
* 3、窗口最小为宽高100,小于等于100时,宽高值默认为浏览器窗口的百分比;
*
*
* 作 者:宋雷鸣
* 开发时间: 2015年9月19日
*/
//窗体Jquery对象
MsgBox.prototype.WinBox = null;
//确认按钮的事件
MsgBox.prototype.EnterEvent = null;
//结束后的事件
MsgBox.OverEvent = null;
//是否显示右上角关闭按钮
MsgBox.prototype.ShowCloseBtn = true;
//弹出窗口的主类
//title:窗口标题
//info:要展示的信息,如果type为内嵌页页
//width:窗口宽度
//height:窗口高度
//type:窗口类型,confirm为确认,msg为消息,alert为警告,loading;默认为msg,如果为'null'则不显示关闭与按钮(白板窗体)
function MsgBox(title, info, width, height, type, event, overFunc) {
this.EnterEvent = event;
this.OverEvent = overFunc;
this.Init(title, info, width, height, type);
}
//初始化参数
MsgBox.prototype.Init = function (title, info, width, height, type) {
this.Title = title != null && title != "" ? title : "";
this.Info = info;
//如果为空,则为浏览器窗口一半宽高
this.Width = !isNaN(Number(width)) ? Number(width) : $(window).width();
this.Height = !isNaN(Number(height)) ? Number(height) : $(window).height();
//如果宽高小于100,则默认为浏览器窗口的百分比
this.Width = this.Width > 100 ? this.Width : $(window).width() * this.Width / 100;
this.Height = this.Height > 100 ? this.Height : $(window).height() * this.Height / 100;
this.WinId = new Date().getTime() + "_" + Math.floor(Math.random() * 1000 + 1);
this.Type = type == null ? "null" : type;
}
//创建窗口,并打开
MsgBox.prototype.Open = function () {
//判断是否已经存在窗口
var WinBox = $("#MsgBox");
if (WinBox.size() > 0) WinBox.remove();
//生成窗口
this.Mask();
this.BuildFrame();
this.BuildContext();
this.BuildButton();
}
//生成窗体外框,包括标题
MsgBox.prototype.BuildFrame = function () {
var hg = $(window).height();
var wd = $(window).width();
var closeFunc = String(this.OverEvent);
后面还有 113 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
