Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.