计算Dialog居中位置。

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';
}

 

调用Dialog位置方法。 

 var DialogLocation = CalcShowModalDialogLocation(500, 260);
                var result = window.showModalDialog("URL", window, DialogLocation);

 

 

 

 

相关文章:

  • 2021-05-26
  • 2021-09-04
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-07-07
  • 2021-07-08
相关资源
相似解决方案