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

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

irt.org | Knowledge Base | JavaScript | Window | Q198 [ previous next ]

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

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?'


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.