首页 > 编程 > JavaScript > 正文

jquery 得到当前页面高度和宽度的两个函数

2019-11-21 00:43:59
字体:
来源:转载
供稿:网友
复制代码 代码如下:

//======需引用jquery框架======//

//返回当前页面高度

function pageHeight(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight :
document.body.clientHeight;
}else{
return self.innerHeight;
}
};



//返回当前页面宽度
function pageWidth(){
if($.browser.msie){
return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth :
document.body.clientWidth;
}else{
return self.innerWidth;
}
};

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表