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

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?

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

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?

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>

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.