Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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?

You are here: irt.org | FAQ | JavaScript | Screen | Q433 [ previous next ]

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>

©2018 Martin Webb