# Centered popup window

**URL:** <https://forum.kirupa.com/t/centered-popup-window/14873>\
**Category:** Uncategorized\
**Created:** [March 3, 2003, 9:26pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873 "2003-03-03T21:26:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shuga](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@shuga](https://forum.kirupa.com/u/shuga)\
**Post date:** [March 3, 2003, 9:26pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/1 "2003-03-03T21:26:59Z")

</div>

is there anything i can add to this

```php

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

```

to make the window exactly centered when it pops up?

thanks

-----------------------edit------------------------------------

here’s what i have now

```php

<html>
<head>
<title>aaronsleeper.com</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
centerWidth = (screen.width) ? (screen.width-w)/2 : 0;
centerHeight = (screen.height) ? (screen.height-h)/2 : 0;  
window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body bgcolor="#7A0A08" onLoad="MM_openBrWindow('flashSite.html','aaronsleeper','width=640,height=480,top='+centerHeight+',left='+centerWidth+'')">
</body>
</html>

```

but it’s not working

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:02pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/2 "2003-03-03T22:02:58Z")

</div>

hey **shuga** =)

did you read my reply in your past thread about popups? :-\

if it’s still the same question … check the attachment 🙂

[size=1] **credit.** popup window code by lostinbeta ;)[/size]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:04pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/3 "2003-03-03T22:04:33Z")

</div>

thanks! =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:05pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/4 "2003-03-03T22:05:15Z")

</div>

I see you like my script Kax… YAY :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:06pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/5 "2003-03-03T22:06:08Z")

</div>

no problem 😏

[size=1] **ps.** you didn’t read it … did you? :P[/size]

[size=1] **edit.** [/size]  
actually yes. i like it =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:10pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/6 "2003-03-03T22:10:13Z")

</div>

i can’t make it work

[http://www.aaronsleeper.com/base.html](http://www.aaronsleeper.com/base.html)

what’s wrong with the code there?

the name is correct for the file i want to open (flashSite.html) and i set the dimensions to 640x480 … i’m not sure what i copied wrong ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:21pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/7 "2003-03-03T22:21:14Z")

</div>

come on **shuga**!! 😛 it’s so obvious …

your problem is that i have no idea what your problem is :-\

where are you **lostinbeta**!!? :hair: 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:44pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/8 "2003-03-03T22:44:02Z")

</div>

come on **shuga**!! it’s so obvious …

😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:47pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/9 "2003-03-03T22:47:01Z")

</div>

it works  
thank you so much  
[www.aaronsleeper.com/base.html](http://www.aaronsleeper.com/base.html)

what did you do?

i looked at the code … but i don’t understand

and what’s with the symerror function?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 10:51pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/10 "2003-03-03T22:51:34Z")

</div>

```php
<body ... ml','aaronsleeper.com',640,480,'no','no');">

```

```php
<body ... ml','aaronsleepercom',640,480,'no','no');">

```

can you see the difference?

> and what’s with the symerror function?

lol 😛 😛 … stupid me :trout:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 3, 2003, 11:25pm UTC](https://forum.kirupa.com/t/centered-popup-window/14873/11 "2003-03-03T23:25:12Z")

</div>

Congrats 😛

I see your design is improving slightly each time I see this layout. Good Job, I like it.

A few suggestions about this pop-up.

People with pop-up stoppers will never see your site because it prevents the pop-up from happening. My suggestion is that on your MAIN window (the window that launches your pop-up) you should include 2 links. 1 to open up in normal mode (so people with pop-up stoppers can see it, and pop-ups can be annoying), and another to open it in a pop-up.

Just a suggestion :love:
