PDA

View Full Version : symmetric proportionate resize



SunWuKung
9 Feb 2012, 3:19 AM
Hi,

Is there a way to create a panel/window that always stays at the center of the browser even during the resize of the panel? When you resize the panel all of its sides are resized proportionately at the same time so its proportions always stay the same and its center remains at the center.

The aim is to put a flash movie into the container, so that the user could resize it while it would always stay in the center of the browser.

I know that I can center the paner after resize, but that is not what I am looking for.
Thanks for the help.
SWK

mitchellsimoens
9 Feb 2012, 7:37 AM
You can re position the panel on resize

SunWuKung
10 Feb 2012, 5:05 AM
The problem is that if I do that than after I resize the panel it will jump back to the center - this way I would never be able to resize it to take all the available space (half of it would always remain).

A workaround could be to double the resize before centering:
newWidth=origWidth+changeWidth*2
newHeight=origHeight+changeHeight*2
but I don't know how the resize function for this resize could be changed to do this.

Thanks for the help.
SWK.