联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

基于jquery的获取浏览器窗口大小的代码 - Web前端

作者:98wpeu发布时间:2026-06-11分类:网页前端技术浏览:5


导读:复制代码代码如下:functiongetTotalheight(){if($.browser.msie){returndocument.compatmode=="CSS1...
复制代码 代码如下:
functiongetTotalheight(){
if($.browser.msie){
returndocument.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);

标签:浏览器大小窗口代码Webjquery


网页前端技术排行
最近发表
网站分类
标签列表