页面垂直居中,登录之类的页面会用到,css似乎没办法实现,用js来做吧

var valgin = function(){
    var height = window.innerHeight || 
                         window.document.documentElement.clientHeight ||
                         window.document.body.clientHeight;

    var t=$$('body')[0];
    var top = (height - t.getHeight()) / 2; 
    top = top>0 ? top : 0;
    t.setStyle({marginTop : top+'px'});
//    t.setStyle({top:top+'px', 'position':'absolute'});
};

window.onload = valgin;
window.onresize = valgin;