您的位置:首页 > Web前端 > JQuery

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

2018-10-12 14:03 495 查看

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);

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: