function pos(){
this.getClientWidth=function(){return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;}
this.getClientHeight=function(){return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;}
this.getBodyScrollTop=function(){return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);}
this.getBodyScrollLeft=function(){return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);}
this.getDocumentWidth=function(){return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;}
this.getDocumentHeight=function(){return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;}
this.getClientCenterX=function(){return parseInt(this.getClientWidth()/2)+this.getBodyScrollLeft();}
this.getClientCenterY=function(){return parseInt(this.getClientHeight()/2)+this.getBodyScrollTop();}
}
p=new pos();
alert(p.getClientHeight());
Манипуляции с размерами Экрана
Страница: 1
Сообщений 1 страница 1 из 1
Поделиться12012-01-16 14:49:44
Страница: 1