2 qq 28968141 qq_28968141 于 2015.07.15 10:08 提问

弹框的X不起作用 点击无反应
JRF.popupWindow = function(i) {
    var E = "";
    var s = "_blank";
    var y = "500";
    var u = "300";
    var t = "auto";
    var a = false;
    var g = "0.5";
    var c = true;
    var C = 0;
    var A = 0;
    var F = true;
    var D = "";
    var o = 70;
    var l = 10;
    var r = true;
    var d = false;
    var h = JRF.top.document.documentElement.clientWidth;
    var m = JRF.top.document.documentElement.clientHeight;
    if (! ($.browser.msie == true)) {
        h = JRF.top.document.body.clientWidth
    }
    var k = (h - y - l) / 2;
    var w = (m - u - o) / 2;
    var q = 24;
    var z = 5;
    var j = "";
    var B = {};
    B = $.extend({},
    B, i);
    if (B.autoPopup != null) {
        a = B.autoPopup
    }
    if (B.title != null) {
        E = B.title
    }
    if (B.frameSrcUrl != null) {
        s = B.frameSrcUrl
    }
    if (B.autoPopup != null) {
        s += "&act=close"
    }
    if (B.bannerDisplay != null) {
        F = B.bannerDisplay
    }
    if (B.framePadding != null) {
        r = B.framePadding
    }
    if (B.bgClose != null) {
        d = B.bgClose
    }
    if (!F) {
        F = "display:none;";
        D = "background:none;";
        o = 0;
        l = 0
    } else {
        F = ""
    }
    if (!r) {
        D += "padding:0;";
        o = 0;
        l = 0;
        q = 0;
        z = 0;
        j = 'allowtransparency="true"'
    }
    if (B.width != null) {
        y = B.width
    }
    if (y > h - l) {
        y = h - l
    }
    if (B.height != null) {
        u = B.height
    }
    if (u > (m - o)) {
        u = m - o
    }
    if (B.frameScrolling != null) {
        t = B.frameScrolling
    }
    if (B.opacity != null) {
        g = B.opacity
    }
    if (B.leftMar != null) {
        k = B.leftMar
    } else {
        k = (h - y - l) / 2
    }
    if (B.topMar != null) {
        w = B.topMar
    } else {
        w = (m - u - o) / 2
    }
    if (B.displayBg != null) {
        c = B.displayBg
    }
    if (B.offsetX != null) {
        C = B.offsetX
    }
    if (B.offsetY != null) {
        A = B.offsetY
    }
    var v = parseInt(Math.random() * 10000);
    var f = "<iframe " + j + ' id="popupWindowIframe' + v + '" class="popupWindowIframe" src="" frameborder="0" scrolling="' + t + '" style="width:' + (y - q + 12) + "px; height:" + (u - z) + 'px;"></iframe>';
    var x = true;
    if (B.divId != null) {
        x = false;
        f = $(B.divId).html()
    }
    if (B.divContent != null) {
        x = false;
        f = B.divContent
    }
    if (c) {
        JRF.bg(v, g)
    }
    var p = "";
    var b = JRF.top.$("body").scrollTop();
    if (b == 0) {
        b = JRF.top.$("html").scrollTop()
    }
    p += '<div id="popupWindow' + v + '" class="formDialog" style="width:' + y + "px; left:" + (k - C) + "px; top:" + (w - A + b) + 'px;">' + '<div class="formTL" id="dragHandle_' + v + '" style=\'' + F + '\'><div class="formTR"><div class="formTC"><h3>' + E + '</h3></div></div></div><div class="formBL" style=\'' + D + "'><div class=\"formBR\" style='" + D + '\'><div class="formBC" id="formBC' + v + '" style="height:auto;' + D + '"><div class="formMSG" style="position: relative;">' + f + "</div><div class='formBtns'><div class='formt_bk'></div></div></div><div id=\"waitingP" + v + '" class="waitingP" style="height:auto;"></div></div></div><div class="formBtl"><div class="formBtr"><div class="formBtm"></div></div></div><a href="javascript:;" class="formX ' + (F ? "formX_old": "") + "\" hidefocus='true'></a></div>";
    var n;
    if (JRF.isIE6()) {
        n = JRF.top.$(p).appendTo("body");
    } else {
        n = JRF.win.$(p).appendTo(JRF.top.document.body);
        n.show();
    }
    if ($.browser.msie && $.browser.version == 6) {
        $("#fixFlashIframe" + v).attr("height", ($("#popupWindow" + v).height()) + "px")
    }
    if (x) {
        JRF.dom.find("#waitingP" + v).height(JRF.dom.find("#formBC" + v).height());
        JRF.dom.find("#waitingP" + v).width(JRF.dom.find("#formBC" + v).width())
    } else {
        JRF.dom.find("#waitingP" + v).hide()
    }
    if (B.divInit != null) {
        B.divInit(v)
    }

    JRF.dom.find("#popupWindow" + v).ready(function() {

        if (x) {

            JRF.dom.find("#popupWindowIframe" + v).attr("src", JRF.addUrlParams(s, "popupID=" + v)).load(function() {
                JRF.dom.find("#waitingP" + v).css("display", "none")
            })
        }
        Drag.init(JRF.top.document.getElementById("dragHandle_" + v), JRF.top.document.getElementById("popupWindow" + v));
        if (!JRF.isNull(B.close)) {
            n.find(".formX").click(B.close);
        } else {
            n.find(".formX").bind("click",
            function() {
                JRF.closePopupWindow(v);
                return false
            });
        }
        n.find(".formTL").disableSelection();
        if (B.bgClose) {
            JRF.dom.find("#popupBg" + v).bind("click",
            function() {
                JRF.closePopupWindow(v);
                return false
            })
        }
        JRF.dom.find('body input:first').focus();
    });
    if (JRF.isNull(top._popupOptions)) {
        top._popupOptions = {}
    }
    if (JRF.isNull(top._popupOptions["popup" + v])) {
        top._popupOptions["popup" + v] = {}
    }
    if (!JRF.isNull(i.callArgs)) {
        top._popupOptions["popup" + v].callArgs = i.callArgs
    }
    top._popupOptions["popup" + v].options = i;
    top._popupOptions["popup" + v].change = false;
    return v
};
JRF.setPopupWindowChange = function(b, a) {
    if (JRF.isNull(JRF.top._popupOptions)) {
        return
    }
    if (JRF.isNull(JRF.top._popupOptions["popup" + b])) {
        return
    }
    JRF.top._popupOptions["popup" + b].change = a
};
JRF.closePopupWindow = function(g, d) {
    if (g) {
        try {
            if (JRF.isNull(top._popupOptions["popup" + g])) {
                return;
            }
            var c = top._popupOptions["popup" + g];
            if (c.refresh) {
                top.location.reload();
            }
            JRF.win.JRF.removeAllIng(false);
            var b = c.options;
            if (!JRF.isNull(b.closeFunc)) {
                if (d) {
                    b.closeFunc(d);
                } else {
                    b.closeFunc(top._popupOptions["popup" + g].closeArgs);
                }
            }
            top._popupOptions["pupup" + g] = {};
            JRF.closePopupWindow_Internal(g);
        } catch(f) {}
    } else {
        JRF.removeBg();
        JRF.dom.find(".formDialog").remove()
    }
};

2个回答

caozhy
caozhy   Ds   Rxr 2015.07.15 11:30

这代码怎么看怎么像混淆过的。变量名都处理了。建议调试下或者干脆换一个别的。

save4me
save4me   Ds   Rxr 2015.07.15 12:05

你有定义B.close吗?
另外自带的关闭弹窗函数的签名是JRF.closePopupWindow = function(g, d),调用的是JRF.closePopupWindow(v);,感觉怪怪的。

Csdn user default icon
上传中...
上传图片
插入图片