PDA

View Full Version : small center popup problem


patrick
06-04-2001, 10:38 AM
small problem.
what do I have to write in my index´(html) to have a centered popup(flash) and not like it is at the moment at my side?

mgb
06-04-2001, 11:11 PM
Put this in the head section of the page that LAUNCHES the popup:

<TITLE>centWin</TITLE>
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT"><!--
if(screen){
topPos=0
leftPos=0
}
function getPage(thePage,wt,ht){
leftPos= (screen.width-wt)/2
topPos = (screen.height-ht)/2
newWin1 = window.open(thePage,'aWin','toolbars=no,resizeable =no,scrollbars=no,left='+leftPos+',top='+topPos+', width='+wt+',height='+ht)
}
// -->
</script>
</HEAD>

And for the Flash button: GetURL("javascript:getPage('yourfilename.html',500,400)")

~mgb

patrick
06-05-2001, 12:39 PM
thanks for your help

i did it now like this:

meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
win = window.open(theURL,winName,features);
center_x = screen.availWidth/2;
center_y = screen.availHeight / 2;

new_x = center_x - 489; //screen width / 2;
new_y = center_y - 240; //screen height / 2;
win.moveTo(new_x, new_y);

win.focus();
}
//-->
</script>
</head>

patrick
06-07-2001, 05:10 PM
thanks, for the help

I did it in another way:

<head>

<title>portfolio</title>

<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<script language="JAVASCRIPT" type="TEXT/JAVASCRIPT">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
win = window.open(theURL,winName,features);
center_x = screen.availWidth/2;
center_y = screen.availHeight / 2;

new_x = center_x - 489; //screen width / 2;
new_y = center_y - 240; //screen height / 2;
win.moveTo(new_x, new_y);

win.focus();
}
//-->
</script>
</head>