基于jquery的获取浏览器窗口大小的代码 - Web前端
作者:98wpeu发布时间:2026-06-11分类:网页前端技术浏览:4
导读:复制代码代码如下: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);
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);
相关推荐
- jQuery的学习步骤 - Web前端
- Web开发者必备的12款超赞jQuery插件 - Web前端
- jquery异步请求实例代码 - Web前端
- jQuery学习笔记之jQuery的DOM操作 - Web前端
- 汉化英文版的Dreamweaver CS5并自动提示jquery - Web前端
- jQuery ajax serialize()方法的使用以及常见问题解决 - Web前端
- Jquery replace 字符替换实现代码 - Web前端
- Web开发者必备的12款超赞jQuery插件 - Web前端
- 在次封装easyui-Dialog插件实现代码 - Web前端
- QUnit jQuery的TDD框架 - Web前端
- 网页前端技术排行
- 最近发表
-
- WordPress随机显示特色图片插件:Random Post Thumbnails
- KeePass实现Chrome浏览器自动填充密码方法一
- LNMP一键包nginx 301强制跳转到https教程
- KeePass实现Chrome浏览器自动填充密码方法二
- #建站# 免费的VPS管理软件Xshell8/Xftp8中文版下载
- 使用Xshell 8连接VPS教程_电脑登录vps的方法
- WordPress评论界面添加烟花????效果
- 不同浏览器书签同步方案:坚果云+Floccus_详细使用教程
- iOS端KeePassXC客户端APP:Strongbox Password Safe
- 给WordPress评论中的Gravatar头像图片添加ALT属性


