<html>
<head>
<title>新开一个命名窗口</title>
</head>
<body>
<a href="#" onclick="window.open(aaa.htm','','width=300,height=300')">新开一个指定大小的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes')">新开一个指定大小的、有菜单栏的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes')">新开一个指定大小的、有菜单栏的、有状态栏的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,resizable=no')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、不能调整大小的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,resizable=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、可以调整大小的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,location=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、有地址栏的窗口</a><br>
<a href="#" onclick="window.open(aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,location=yes,scrollbars=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、有地址栏的、有滚动条的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,location=yes,scrollbars=no')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、有地址栏的、无滚动条的窗口</a><br>
</body>
</html>
<head>
<title>新开一个命名窗口</title>
</head>
<body>
<a href="#" onclick="window.open(aaa.htm','','width=300,height=300')">新开一个指定大小的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes')">新开一个指定大小的、有菜单栏的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes')">新开一个指定大小的、有菜单栏的、有状态栏的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,resizable=no')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、不能调整大小的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,resizable=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、可以调整大小的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,location=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、有地址栏的窗口</a><br>
<a href="#" onclick="window.open(aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,location=yes,scrollbars=yes')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、有地址栏的、有滚动条的窗口</a><br>
<a href="#" onclick="window.open('aaa.htm','','width=300,height=300,menubar=yes,status=yes,toolbar=yes,location=yes,scrollbars=no')">新开一个指定大小的、有菜单栏的、有状态栏的、有工具栏的、有地址栏的、无滚动条的窗口</a><br>
</body>
</html>
说明:
popUpWin = window.open(‘page.htm’, 'popUpWin', 'toolbar=no,location=no, directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width=100,height=100, left=100,top=100,screenX=100,screenY=100’);
弹出窗口参数一览
弹出窗口的命令格式:
window.open(‘URLStr’, ‘WindowName’, ‘Property’);
其中:
1.window.open命令用于在网页上弹出一个新窗口。
2.URLStr:弹出窗口所显示的页面
3.WindowName:弹出窗口的名称,可以任意指定,也可以用’’来代替
4.Property:用于控制弹出窗口显示的属性,具体可控制的参数有:
5.Toolbar:是否显示浏览器工具栏,yes为显示,no为不显示
6.Location:是否显示游览器地址栏,yes为显示,no为不显示
7.Directories:是否显示目录按钮,yes为显示,no为不显示
8.Status:是否显示状态栏,yes为显示,no为不显示
9.Menubar:是否显示菜单条,yes为显示,no为不显示
10.Scrollbar:是否激活水平和垂直流动条,yes为显示,no为不显示
11.Resizable:是否可以改变窗口大小,yes为显示,no为不显示
12.Width:指定窗口的宽度,以像素为单位
13.Height:指定窗口的高度,以像素为单位
14.Left:指定窗口距屏幕左端的距离,以像素为单位
15.Top:指定窗口距屏幕顶端的距离,以像素为单位
16.screenX:等同于Left属性
17.screenY:等同于Top属性
转载于:https://blog.51cto.com/wnight88/140715