|
Q1416 How can I open a popup window and position it relative to the existing window?
irt.org | Knowledge Base | JavaScript | Window | Q1416 [ previous next ]
Q1416 How can I open a popup window and position it relative to the existing window?
Try the following:
<script language="JavaScript"><!--
var x = 0, y = 0; // default values
if (document.all) {
x = window.screenTop + 100;
y = window.screenLeft + 100;
}
else if (document.layers) {
x = window.screenX + 100;
y = window.screenY + 100;
}
var popup = window.open('popup.htm','popup','width=100,height=100,top='+y+',screenY='+y+',left='+x+',screenX='+x);
//--></script>
|
Feedback on 'Q1416 How can I open a popup window and position it relative to the existing window?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.