PDA

View Full Version : centered window



mshepherd
12 Apr 2010, 3:20 PM
is there a way to keep a window centered after the browser window is resized? It is for a simple login page.

mpawlowski
12 Apr 2010, 4:00 PM
Ext.EventManager.onWindowResize(function() {
//resize logic
});

x position of window = document width - (window width * 0.5);
y position of window = document height - (window height * 0.5);

then use
window.setPosition(newX, newY);

mshepherd
13 Apr 2010, 7:46 AM
thanks, i just called window.center() in that event manager.