---
title: "window.showModalDialog与window.open全屏显示"
author: "stta04"
date: "2009-04-30T17:14:00Z"
tags: []
slug: "window-showmodaldialog-window-open"
draft: false
lastmod: "2009-04-30T17:14:00Z"
id: 377631
url: "https://stta04.iteye.com/blog/377631"
---

搞了半天就是搞不出模式对话框的全屏显示，原来其与window.open的参数设置完全不同.

function winModalFullScreen(strURL)  
{  
var sheight = screen.height-70;  
var swidth = screen.width-10;  
var winoption ="dialogHeight:"+sheight+"px;dialogWidth:"+ swidth +"px;status:yes;scroll:yes;resizable:yes;center:yes";

var tmp=window.showModalDialog(strURL,window,winoption);  
return tmp;  
}

function winOpenFullScreen(strURL)  
{  
var sheight = screen.height-70;  
var swidth = screen.width-10;  
var winoption ="left=0,top=0,height="+sheight+",width="+swidth+",toolbar=yes,menubar=yes,location=yes,status=yes,scrollbars=yes,resizable=yes";

var tmp=window.open(strURL,'',winoption);  
return tmp;  
}