如何修复网页的位置?

时间:2013-08-21 09:36:10

标签: asp.net

在网络应用程序中,我正在尝试使用这样的javascript打开网页:

OnClientClick="window.open('chat.aspx', 'OtherPage','width=400,Height=440,Top=350,left=0,titlebar=no,menubar=yes,location=no,resizable=no,channelmode=no,directories=no,status=no,scrollbar=no');"

现在我想将网页的位置修复到系统的右侧角是可能的,请帮帮我。

1 个答案:

答案 0 :(得分:0)

function popup( width, height, url ) {
var left=screen.width-width;
var top=screen.height-height;
var pWin=open( url, 'win', 'width='+width+',height='+height+',left='+left+',t op='+top );
if( pWin.screenX != null ) {
pWin.screenX=left;
pWin.screenY=top;
}
}

你最终会得到一个至少大约在窗口中的窗口 屏幕的右下角,根据不同而有所不同 确切浏览器使用。这可能是也可能不适合您 目的;它可以起作用。无论如何,请注意它 在Firefox和IE中合理地工作。