showDialog IE与火狐兼容问题

来源:互联网 发布:sql语句查询两张表 编辑:程序博客网 时间:2024/05/23 19:34

兼容火狐和IE的showModalDialog

//模态窗口兼容IE 和火狐

function CalcShowModalDialogLocation(dialogWidth, dialogHeight) {
    var iWidth = dialogWidth;
    var iHeight = dialogHeight;
    var iTop = (window.screen.availHeight - 20 - iHeight) / 2;
    var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
    return 'dialogWidth:' + iWidth + 'px;dialogHeight:' + iHeight + 'px;dialogTop: ' + iTop + 'px; dialogLeft: ' + iLeft + 'px;center:yes;scroll:no;status:no;resizable:0;location:no';

}



var DialogLocation = CalcShowModalDialogLocation(520, 400);
    var result = window.showModalDialog('${base}/list/addOupdatePointRouleList.htm?ruleCode=0&isNew=1', 
    window, DialogLocation);
    document.location.reload();

0 0
原创粉丝点击