positioning a new window - help needed

They have: 5,633 posts

Joined: Jan 1970

To open a new browser window I use this code:

<a href="" onClick='msgWindow=window.open ("main.htm","displayWindow", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no,
width=210, height=320"); return false'parentmain.htmreturn document.MM_returnValue' class="link">

How do I decide which coordinates the upper left corner should have?

**edit by JP Stones = spaces added after commas to maintain tables width**

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

You can position it by pixels using left and top in IE, and screenX and screenY in NS. To make it work in both, use both sets, like this:

window.open('page.htm','mywindow','width=400,height=200,left=0,top=100,screenX=0,screenY=100');

----------
John Pollock
http://www.pageresource.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.