By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,940 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,940 IT Pros & Developers. It's quick & easy.

Urgent - popup position reletive to centre

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.