Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Re: DHTML Menu
- From: javascript@xxxxxxxxxx (Rodney Myers)
- Subject: [Javascript] Re: DHTML Menu
- Date: Thu, 18 Apr 2002 14:54:22 +0100
You don't say where the window does position itself, but my guessis that at best it would be too far right and too far down and that the top left corner would be central in the window? >From a maths perspective top=(screen.height-h)/2 would make the top of the window half way down, which is different from centring the popup because it takes no account of the height of the popup, so you you would want to adjust by half of that. >From a hjavascripting perspective I am by no means certain that math expressions can be used in this context. I would tend to want to compute these in advance and build up the string of window attributes to include the answer rather than expect the window.open method to be able to compute math expressions hth Rodney phumes1 wrote: > I'm using the DHTML menu > (http://www.webreference.com/dhtml/hiermenus/latest/)on my page and would > like the popup window to automatically center on the screen. > > How can I incorporate the "top" and "left" within the code in my > "hm_arrays" file? > > The below code doesn't center the popup window yet I get no JS errors? > > ["E<nable","javascript:window.open('admin/accounts/enable.cfm','','toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=(screen.height-h)/2,left=(screen.width-w)/2,width=280,height=130')",1,0,0], > > +-----------------------------------------------------------------------------------+ > > Philip Humeniuk > phumes1@xxxxxxxxxx > phil.humeniuk@xxxxxxxxxx > +------------------------------------------------------------------------------------+
- References:
- [Javascript] Re: DHTML Menu
- From: phumes1
- [Javascript] Re: DHTML Menu
- Prev by Date: [Javascript] Re: DHTML Menu
- Next by Date: [Javascript] Rounding to 2 decimal places
- Previous by thread: [Javascript] Re: DHTML Menu
- Next by thread: [Javascript] Rounding to 2 decimal places
- Index(es):