Menu
Hello guys and girls.
I am a complete Java n00b, so please be gentle with me…
I have this script on my web page, and it works fine with IE, but Firefox totally ignores it….
What am i doing wrong ?
<SCRIPT>
var popup = new Object()
function CenterPopup(URL, width, height)
{
var X = document.body.clientWidth / 2
var Y = document.body.clientHeight / 2
popup = window.open(URL, ‘PopUp’,
‘scrollbars=0 ‘ +
‘width=’ + width + ‘ ‘ +
‘height=’ + height + ‘ ‘ +
‘top=’ + (window.screenTop + (Y – (height/2))) + ‘ ‘ +
‘left=’ + (window.screenLeft + (X – (width/2))))
popup.focus()
}
</SCRIPT>
<i>
</i>var popup = new Object()
function CenterPopup(URL, width, height)
{
// Window dimensions:
var theWidth, theHeight;
if (window.innerWidth)
theWidth=window.innerWidth;
else if (document.documentElement && document.documentElement.clientWidth)
theWidth=document.documentElement.clientWidth;
else if (document.body)
theWidth=document.body.clientWidth;
if (window.innerHeight)
theHeight=window.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
theHeight=document.documentElement.clientHeight;
else if (document.body)
theHeight=document.body.clientHeight;
// Window origin
var originX, originY;
if (window.innerHeight) {
originX=screenX+(window.outerWidth-window.innerWidth);
originY=screenY+(window.outerHeight-window.innerHeight);
}
else {
originX=screenLeft;
originY=screenTop;
}
var X = theWidth/2;
var Y = theHeight/2;
var features='"scrollbars=0, ' +
'width=' + width + ', ' +
'height=' + height + ', ' +
'top=' + parseInt(originY + (Y - (height/2))) + ', ' + //
'left=' + parseInt(originX + (X - (width/2))) + '"';
popup = window.open(URL, "PopUp", features);
popup.focus()
}
var popWin = "";
function openwin(url, strWidth, strHeight){
if (popWin != ""){popWin.close()}
leftStr = (screen.width-strWidth)/2;
topStr = (screen.height-strHeight)/2;
windowProperties = "toolbar=no,menubar=no,scrollbars=no,stausbar=no,height="+strHeight+",width="+strWidth+",left="+leftStr+",top="+topStr+"";
popWin = window.open(url,'newWin',windowProperties);
}
[i]Originally posted by Fang [/i]
[B]Can you show the full page or a link? [/B][/QUOTE]
0.1.9 — BETA 6.1