Position a "popup" window

G

Guest

I am using the code below to open a smaller page. The code works fine but
opens the window in the top left of the screen. How can I change it to open
in the centre?
Frontpage 2000

<a
href="javascript:location=location;window.open('popups/1.htm','NMO','height=400,width=400,scrollbars=yes,resizable=yes')">Link to popup</a>
 
J

JCO

I use JimCo Addins which are free. Go to JimCo.com and download the AddIn
named "Spawn".
Once you do this, you can select any graphics or text to spawn a popup. The
popup can be customize in any fashion you need. It lets you pick the window
size and location.


Tom said:
I am using the code below to open a smaller page. The code works fine but
opens the window in the top left of the screen. How can I change it to open
in the centre?
Frontpage 2000

<a
href="javascript:location=location;window.open('popups/1.htm','NMO','height=
 
G

Guest

I believe you can add top and left to position the window:
href="javascript:location=location;window.open('popups/1.htm','NMO','height=400,width=400,top=100, left=100,scrollbars=yes,resizable=yes')">Link to popup</a>

You'd have to play with the settings to center it.
 
J

JCO

That may work but it depends what resolution the computer is set at. I
believe it has to be calculated. Jimco adds code similar to this:
x = (screen.availWidth - w) / 2;
y = (screen.availHeight - h) / 2;

Like I said in the first post, it is much easier to us Spawn from
www.jimco.com
I guess I could look at the code more in depth.


Dan L said:
I believe you can add top and left to position the window:
href="javascript:location=location;window.open('popups/1.htm','NMO','height=
400,width=400,top=100, left=100,scrollbars=yes,resizable=yes')">Link to
popup said:
You'd have to play with the settings to center it.
href="javascript:location=location;window.open('popups/1.htm','NMO','height=
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top