window.onload = function() {
var winWidth = parseInt(document.documentElement.clientWidth);// 客户端浏览器宽度
var winHeight = parseInt(document.documentElement.clientHeight);// 客户端浏览器高度
// iframe全屏
document.getElementById("frmDialog").width = winWidth + "px";
document.getElementById("frmDialog").height = winHeight + "px";
// iframe半屏
//document.getElementById("frmDialog").width = (winWidth / 2) + "px";
//document.getElementById("frmDialog").height = (winHeight / 2) + "px";
};
原文:http://www.cnblogs.com/csharphuang/p/4189930.html