天天看点

基于jquery的获取浏览器窗口大小的代码

function gettotalheight(){ 

if($.browser.msie){ 

return document.compatmode == "css1compat"? document.documentelement.clientheight : document.body.clientheight; 

else { 

return self.innerheight; 

function gettotalwidth (){ 

return document.compatmode == "css1compat"? document.documentelement.clientwidth : document.body.clientwidth; 

else{ 

return self.innerwidth; 

var do_height = gettotalheight(); 

var do_width = gettotalwidth(); 

alert("do_height=="+do_height+"\ndo_width=="+do_width);

继续阅读