注册 登录
编程论坛 ASP技术论坛

页面位置

ta8607 发布于 2007-11-17 10:42, 363 次点击
<html>
<head>
<title>Open Window</title>
<script language="JavaScript">
function OpenWindow()
{
thisWin = window.open("aa.htm", null, "width=500,height=400")

}
</script>
</head>
<body>
<center>
<input type="button" value="Creat New Window" onClick="OpenWindow()">
</center>
</body>
</html>



我现在打开了一个新的页面,但是我想让它在屏幕的右下角显示,应该要怎么做?
谢谢!!!!

[此贴子已经被作者于2007-11-17 10:48:19编辑过]

3 回复
#2
hmhz2007-11-17 12:17
thisWin = window.open("aa.htm", null, "width=500,height=400,bottom=1,right=1")
#3
madpbpl2007-11-17 12:18

function OpenWindow()
{
thisWin = window.open("aa.htm", null, "width=500,height=400")

}
改成
function OpenWindow()
{
var x=screen.width; //屏幕宽度
var y=screen.height; //屏幕高度
var w=500; //新打开窗口的宽度
var h=400; //新打开窗口的高度
var t=(y-h);
var l=(x-w);
thisWin = window.open("aa.htm","","width="+w+",height="+h+",top="+t+",left="+l )
}

#4
ta86072007-11-17 14:15
谢谢楼上两位!!!!!
已经用madpbpl的方法解决.
1