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

Q198 How do I open a window at a given position on the screen?

You are here: irt.org | FAQ | JavaScript | Window | Q198 [ previous next ]

In Netscape Navigator 4 the screenX and screenY attributes were introduced. In Internet Explorer 4 the top and left attributes were introduced. By combining the two both Netscape Navigator 4 and Internet Explorer 4 will allow you to position the window:

<script language="JavaScript"><!--
function openWindow() {
    msgWindow = window.open('','newWin','width=100,height=100,screenX=400,screenY=400,top=400,left=400');
    msgWindow.location.href = 'apage.html';
}
//--></script>

<form>
<input type="button" onClick="openWindow()" value="Click Me">
</form>

Feedback on 'Q198 How do I open a window at a given position on the screen?'

©2018 Martin Webb