Showing results for 
Search instead for 
Did you mean: 

POPUP always in center of browser window? (Design Studio)

0 Kudos

Hi all,

I would like to have a simple pop-up window, which will always be in the center of the browser window. I know I can set two layout values to auto, but what about the other two values (I exclude width and height)? For example, if I set bottom and right margin on auto, what values should I put to the top and left margin, so that the initial popup window will be in the center of the browser window, for all type of resolutions?

View Entire Topic
0 Kudos

Hi Athanasios,

One option is to have a pop up that changes size. You could set the height and width to auto and set the top and bottom borders to the same number and the right and left borders to the same number.

Example: POP_UP1 - top margin: 300, left margin: 200, bottom margin: 300, right margin: 200, width: auto, height: auto.

0 Kudos

How are you managing, that you're not getting the value "auto" as width/height from the Background_PANEL?
Which Version of Design Studio are you working with? Up to now I never had a chance to get the values of width, when setting the width to "auto".

a.tsapanoglou: Is there a chance, that you could use the Dialog instead of a Popup? There you have the automatic-center-feature build in.


0 Kudos

Hi Christian,

You're right- I ran into the same error. I was going off of memory from another autosizing that I had scripted, but I must not have been using auto on that one. I deleted my second option.

I'm with you, using a Dialog or an APPLICATION.alert(""); function could work.