URL: http://www.uburst.com/cgi-bin/dcforum/dcboard.cgi
Forum: uReserve_config
Thread Number: 11
[ Go back to previous page ]

Original Message
"Popup box positioning"

Posted by Kyle Baker [kybaker@dhs.co.la.ca.us] on at 11:44 AM
Could someone point me in the right direction to find out more about how to change where the popup boxes in uReserve are positioned? Users have complained that when they click on a resource to add a reservation, the box that pops up appears on the lower right with the bottom half cut off of the screen. Is there a way to force the popup to appear centered, so that no matter the screen resolution it would always be in the center?...

Thanks in advance for any advice you could give.

Kyle Baker
Webmaster
LA County Office of AIDS Programs and Policy


Table of contents

Messages in this discussion
"RE: Popup box positioning"
Posted by Bill Weiner on at 06:54 AM
To popup the reservation window, uReserve uses the standard JavaScript window.open call with the following "features" settings:

height=400,width=420,dependent=0,fullscreen=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0

I'm not aware of any feature to center the window... but there are some features to specify the X and Y locations of the window. They are:

For Netscape: "screenX" and "screenY"
For IE: "left" and "top"

So you could technically edit the "ureserve.pl" script and add some coordinates in there. Here's how:

STEP 1: Make a backup of your current ureserve.pl script... just in case.

STEP 2: Open your ureserve.pl script in any text editor such as WordPad.

STEP 3: Do a search on the following text:

ONCLICK=\"window.open

(There will actually be two occurances... but you will just be interested in the first occurance).

STEP 4: On that line with the first window.open, you will see where the "features" are set to:

height=$reserve_window_height1,width=435,dependent=0,fullscreen=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0

Just add the new features in there like this:

height=$reserve_window_height1,width=435,dependent=0,fullscreen=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0,screenX=50,screenY=50,left=50,top=50

(I just used 50 in this example...so that the window will always be positioned at the coordinates 50,50...which should at least show up on all screen resolutions).

STEP 5: Save the script (as TEXT if your editor asks)... and try it out!


"RE: Popup box positioning"
Posted by Kyle Baker [kybaker@dhs.co.la.ca.us] on at 12:22 PM
That did the trick. Now no matter the screen resolution of a user, the popup appears in the center of the screen.

Thanks, as always, for your prompt and insightful help.

Kyle Baker
Web Master
LA County OAPP