ITeye博客

浏览器窗口大小发生变化时,让弹出的窗体自动居中

fish_bone · 2011-11-20 17:11 · EXTJS4.0 · Web前端 · window · Extjs4.0 · onWindowResize · center() · Markdown

//浏览器窗口大小发生变化时,让弹出的窗体自动居中
Ext.EventManager.onWindowResize (function(){
    if(addServerInfoWindow){
         addServerInfoWindow.setHeight(document.body.clientHeight/1.5);
        addServerInfoWindow.setWidth(document.body.clientWidth/3);
        addServerInfoWindow.center();
    }
   
    if(updateServerInfoWindow){
         updateServerInfoWindow.setHeight(document.body.clientHeight/1.5);
        updateServerInfoWindow.setWidth(document.body.clientWidth/3);
        updateServerInfoWindow.center();
    }
});

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。