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

Q1404 How can I dock one popup window to the side of another and window keep it that way even if a user moves one of the windows?

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

Possibly. The following will only work on Netscape Navigator 4 (but not on unix platforms):

<html>

<head>
<script language="JavaScript"><!--
// default values:
var x = 400;
var y = 400;
//--></script>

<script language="JavaScript1.2"><!--
x = window.screenX + window.outerWidth;
y = window.screenY + 50;

var popup = window.open('popup.htm','popup','width=100,height=100,top='+y+',screenY='+y+',left='+x+',screenX='+x);

function moved(e) {
    popup.screenX = window.screenX + window.outerWidth;
    popup.screenY = window.screenY + window.outerWidth;
}
//--></script>
</head>

<body onMove="moved()">

....

</body>
</html>

And then in the popup window:

<html>

<head>
<script language="JavaScript"><!--
function moved(e) {
    opener.screenX = window.screenX - opener.outerWidth;
    opener.screenY = window.screenY - opener.outerWidth;
}
//--></script>
</head>

<body onMove="moved()">

....

</body>
</html>

©2018 Martin Webb