layer.open调整自身窗口大小及位置

function showView1() {
var title = "查看";
layer.open({
title: title,
type: 2,
area: ['850px', '520px'],
fixed: false, //不固定
maxmin: true,
content: ctxPath + 'Common/personview?id=2c90bca86c892efd016c89f6d26f0009'
});
}
$(function () {
        if ($("input[name=affordType]").first().val() == manFlag) {
            var topHeight = ($(top.window).height()-381)/2;
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.style(index,{
                height:"381",
                top: topHeight+'px'
            });
            $("#manForm").show();
            $("#comForm").hide();
            currentForm = $("#manForm");
        }
        else {
            $("#manForm").hide();
            $("#comForm").show();
            currentForm = $("#comForm");
        }

    });

 

posted @ 2019-09-06 14:36  Shapley  阅读(3316)  评论(0编辑  收藏  举报