|
Q433 How can I open a window so that the window always opens in the lower right-hand corner of the screen regardless of the screen resolution?
irt.org | Knowledge Base | JavaScript | Screen | Q433 [ previous next ]
Q433 How can I open a window so that the window always opens in the lower right-hand corner of the screen regardless of the screen resolution?
In Netscape Navigator 4 and Internet Explorer 4 try this:
<SCRIPT LANGUAGE="JavaScript"><!--
function openWindowBottomRight(x,y) {
var xMax = 640, yMax=480; // default
if (document.all) var xMax = screen.width, yMax = screen.height;
else if (document.layers) var xMax = window.outerWidth, yMax = window.outerHeight;
var xOffset = xMax - x, yOffset = yMax - y;
msgWindow = window.open('apage.html','newWin','width='+x+',height='+y+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}
//--></SCRIPT>
<FORM>
<INPUT TYPE="BUTTON" onClick="openWindowBottomRight(640,480)" VALUE="Open Window Bottom Right">
</FORM>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.