基于jquery的獲取瀏覽器窗口大小的代碼_jquery
來源:懂視網
責編:小采
時間:2020-11-27 20:58:32
基于jquery的獲取瀏覽器窗口大小的代碼_jquery
基于jquery的獲取瀏覽器窗口大小的代碼_jquery: 代碼如下: function getTotalHeight(){ if($.browser.msie){ return document.compatMode == CSS1Compat document.documentElement.clientHeight : document.body.clientHeight; } else { ret
導讀基于jquery的獲取瀏覽器窗口大小的代碼_jquery: 代碼如下: function getTotalHeight(){ if($.browser.msie){ return document.compatMode == CSS1Compat document.documentElement.clientHeight : document.body.clientHeight; } else { ret

代碼如下:
function getTotalHeight(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight : document.body.clientHeight;
}
else {
return self.innerHeight;
}
}
function getTotalWidth (){
if($.browser.msie){
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);
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
基于jquery的獲取瀏覽器窗口大小的代碼_jquery
基于jquery的獲取瀏覽器窗口大小的代碼_jquery: 代碼如下: function getTotalHeight(){ if($.browser.msie){ return document.compatMode == CSS1Compat document.documentElement.clientHeight : document.body.clientHeight; } else { ret