Song.Site/Utility/CoreScripts/PageBox.js

(开头部分) 16KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*!
* 主  题:《页面弹出窗口》
* 说  明:用于子页面弹出时的窗口。
* 功能描述:
* 1、生成弹出窗口,窗口内包括iframe控件,用于加载实际控制页面;
* 2、窗口弹出时,生成背景遮罩;
* 3、窗口最小为宽高100,小于等于100时,宽高值默认为浏览器窗口的百分比;
*
*
* 作  者:宋雷鸣 
* 开发时间: 2016年12月28日
*/
(function () {
    function pagebox(title, page, width, height, id, patwin) {
        this.Init(title, page, width, height, id, patwin);
    }
    pagebox.version = "1.1";  //版本号
    pagebox.prototype.Parent = null;    //上级窗体
    pagebox.prototype.IsDrag = false;    //是否允许拖动
    pagebox.prototype.CloseEvent = null;    //窗口关闭时的事件
    pagebox.prototype.FullScreenEvent = function () {
        $("html").css("overflow", "hidden");
    };
    pagebox.prototype.WinScreenEvent = function (box) {
        if (Number(box.attr("wdper")) == 100 && Number(box.attr("hgper")) == 100)
            $("html").css("overflow", "auto");
    };
    //初始化参数
    pagebox.prototype.Init = function (title, page, width, height, winid, patwin) {
        if (width == 100 & height == 100) {
            if (this.FullScreenEvent != null) this.FullScreenEvent();
        }
        //屏幕的宽高
        var hg = $(window).height();
        var wd = $(window).width();
        this.Title = title != null && title != "" ? title : " ";
        //如果为空,则为浏览器窗口一半宽高
        width = width != null && width != 0 && width != "" ? Number(width) : wd / 2;
        height = height != null && height != 0 && height != "" ? Number(height) : hg / 2;
        //如果宽高小于100,则默认为浏览器窗口的百分比
        this.Wdper = width > 100 ? width / wd * 100 : width;    //宽度百分比
        this.Hgper = height > 100 ? height / hg * 100 : height;    //宽度百分比
        this.Width = width > 100 ? Number(width) : Math.floor(wd * Number(width) / 100);
        this.Height = height > 100 ? Number(height) : Math.floor(hg * Number(height) / 100);
        this.WinId = winid != null ? winid : new Date().getTime() + "_" + Math.floor(Math.random() * 1000 + 1);
        this.Page = pagebox.getCurrPath(patwin, page);
        //上级窗体
        if (patwin != null) this.Parent = pagebox.getParent(patwin);
    }
    //获取父窗口(iframe对象)
    pagebox.getParent = function (winname) {
        var winbox = $(".PageBox[winid=" + winname + "]", window.top.document);
        return winbox;
    }
    //获取当前窗体对象
    //winname:当前iframe名称,如果为空值,则取最上层的活动窗口
    pagebox.getPagebox = function (winname) {
        if (winname != null) {
            var box = $(".PageBox[winid=" + winname + "]");
            return box;
后面还有 321 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。