diarratech
Technical User
I have trouble centering my popup on a page. Can anyone help me. I know i need to use the following variable to center the popup
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
but it doesn't work
Here is my function popup.js
var newWin = null;
function closeWin(){
if (newWin != null){
if(!newWin.closed)
newWin.close();
}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,
height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}
I call it this way <a href="ma_fenetre.htm"
onclick="popUp(this.href,'console',400,200);return false;">link</a>
thanks
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
but it doesn't work
Here is my function popup.js
var newWin = null;
function closeWin(){
if (newWin != null){
if(!newWin.closed)
newWin.close();
}
}
function popUp(strURL,strType,strHeight,strWidth) {
closeWin();
var strOptions="";
if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,
height="+strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}
I call it this way <a href="ma_fenetre.htm"
onclick="popUp(this.href,'console',400,200);return false;">link</a>
thanks