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

Feedback on: irt.org FAQ Knowledge Base Q1316

irt.org | About | Feedback | 3497 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q1316

Sent by
Sean McLeary on January 17, 2002 at 12:40:32:

Technical:
Not technical enough

Comments:
the suggested method for centering the pop-up over the browser window does not take into account the distance the browser window is separated (top and left) from the top-left-hand corner of the screen. try this instead:

function centerPopup (page)
{
var w=200, h=135, bw, bh, bl, bt, topPos, leftPos;

if (document.all)
{
bw = document.body.clientWidth;
bh = document.body.clientHeight;
bl = window.screenLeft;
bt = window.screenTop;
}
else if (document.layers)
{
bw = window.outerWidth;
bh = window.outerHeight;
bl = window.screenX;
bt = window.screenY;
}

leftPos = Math.floor((bw-w)/2) + bl;
topPos = Math.floor((bh-h)/2) + bt;

attributes = "width=" + w + ",height=" + h + ",top=" + topPos + ",left=" + leftPos;
popUpWin = window.open (page, "winName", attributes);
}


Other feedback on 'irt.org FAQ Knowledge Base Q1316' - show all


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.