swneng

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
   this.context=new Object();
      documentParameter.getRectangle=function (){
                            if(window.innerWidth){
                               return [window.innerWidth,window.innerHeight];
                            }
                            else{
                                  if(document.compatMode=="CSS1Compat"){
                                       return [document.documentElement.clientWidth,document.documentElement.clientHeight];
                                  }
                                  else{
                                       return [document.body.clientWidth,document.body.clientHeight];
                                  }
                            }
                         }
     
     documentParameter.getWidth() =function(){
                          var w=this.getRectangle();
                          return w[0];
                      }
     this.getHeigt() =function(){
                          var h=this.getRectangle();
                          return h[1];
                      }
    }
    var s =new documentParameter();
    alert(s.getWidth());
posted on 2008-09-27 18:14  易哲  阅读(316)  评论(0编辑  收藏  举报