js中window.open()和window.showModalDialog()窗体大小设置

function openwin(url,wh,hg,lf,tp)
    {    
      var xLeft=(window.screen.width-wh)/2;
      var yTop=(window.screen.height-hg)/2;
      var newwin=window.open(url,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=auto,width="+wh+",height="+hg+",left="+xLeft+",top="+yTop);
      newwin.focus();
      return false;

    }

function showModalDialogWin(url,wh,hg) {
        var obj = window.showModalDialog(url, window,"status:false;dialogWidth:"+wh+"px;dialogHeight:"+hg+"px;scrollbar=no;help: no;resizable:no;status:no;");
}


你可能感兴趣的:(function,url)