470,647 Members | 1,131 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

Urgent - popup position reletive to centre

I'd to postion a pop up windown to appear in a position relevtive to
the centre of the screen, rather than top=200, left=200.

Is there any way i can do this?

Alternatively i need a script that will position the popup in the same
place irellevent of browser window and resolution....

Any ideas?

Thanks
Jul 20 '05 #1
1 1750
ro*********@ntlworld.com (Robster) writes:
I'd to postion a pop up windown to appear in a position relevtive to
the centre of the screen, rather than top=200, left=200.

Is there any way i can do this?
You didn't say what it is for, so I assume it's for the internet.

The answer is: Maybe, but there are some cases where it is bound to
fail, so I recommend they you let the browser place the window.

<URL:http://www.infimum.dk/HTML/JSwindows.html#ref_3_3>

If you decide to to it anyway, you can find the screen resolution
as
screen.availHeight
and
screen.availWidth

If you know the size of your popup, you can then find the top and left
position that corresponds to centering it, if possible.
Alternatively i need a script that will position the popup in the same
place irellevent of browser window and resolution....


The only location that is independent of resolution is 0,0. With an MDI
browser, you can't place anything independently of the browser window.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Shaun McKinnon | last post: by
4 posts views Thread by @(none) | last post: by
4 posts views Thread by VR | last post: by
18 posts views Thread by Colin McGuire | last post: by
reply views Thread by GV | last post: by
4 posts views Thread by jobs | last post: by
1 post views Thread by chris f | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.