window.open(pageURL,name,parameters) 其中: pageURL 为子窗口路径 name 为子窗口句柄 parameters 为窗口参数(各参数用逗号分隔) 具体你可以google下window.open,或者也可以看看这个 http://www.cnblogs.com/stswordman/archive/2006/06/02/415853.html
将下面保存为html文件,然后打开试试看<script type="text/javascript"> // 用top和left来定位窗体的位置 var top = 200; var left = 200; window.open("http://www.baidu.com","_blank","height=350,width=600,top="+top+",left="+left+",resizable=no,scrollable=no,toolbar=no,status=no,location=no") </script>
其中:
pageURL 为子窗口路径
name 为子窗口句柄
parameters 为窗口参数(各参数用逗号分隔) 具体你可以google下window.open,或者也可以看看这个
http://www.cnblogs.com/stswordman/archive/2006/06/02/415853.html
将下面保存为html文件,然后打开试试看<script type="text/javascript">
// 用top和left来定位窗体的位置
var top = 200;
var left = 200;
window.open("http://www.baidu.com","_blank","height=350,width=600,top="+top+",left="+left+",resizable=no,scrollable=no,toolbar=no,status=no,location=no")
</script>
在你需要用自定义大小的窗口打开的页面中加入
<sctipt>
window.onload = function(){
var aopen =window.open("","newwin","height=710, width=1024, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=yes");
aopen.location.href = window.location.href;
window.opener = null;
window.close();
}
</script>//窗口大小:height=高, width=宽 窗口位置 top=顶部距离, left=左边距离
//你若要完全居中,可以自己去算top和left的值。
//window.screen.width window.screen.height 去取得屏幕大小
//这样应该居中
//top = ((window.screen.height - height(窗口高度)) / 2)
//left = ((window.screen.width - width(窗口宽度)) / 2)//其他参数自己网上搜索。