JQuery-------做手机Web开发做浏览器兼容用到了,所以在网上找了些汇总下。

alert($(window).height()); //浏览器当前窗口可视区域高度
alert($(document).height()); //浏览器当前窗口文档的高度
alert($(document.body).height());//浏览器当前窗口文档body的高度
alert($(document.body).outerHeight(true));//浏览器当前窗口文档body的总高度 包括border padding margin
alert($(window).width()); //浏览器当前窗口可视区域宽度
alert($(document).width());//浏览器当前窗口文档对象宽度
alert($(document.body).width());//浏览器当前窗口文档body的高度
alert($(document.body).outerWidth(true));//浏览器当前窗口文档body的总宽度 包括border padding margin

-------------------------------------------------JS---------------------------------------------------------------

网页可见区域宽:document.body.clientWidth**
网页可见区域高:document.body.clientHeight**
网页可见区域宽:document.body.offsetWidth (包括边线的宽)**
网页可见区域高:document.body.offsetHeight (包括边线的宽)**
网页正文全文宽:document.body.scrollWidth**
网页正文全文高:document.body.scrollHeight**
网页被卷去的高:document.body.scrollTop**
网页被卷去的左:document.body.scrollLeft**
网页正文部分上:window.screenTop**
网页正文部分左:window.screenLeft**
屏幕分辨率的高:window.screen.height**
屏幕分辨率的宽:window.screen.width**
屏幕可用工作区高度:window.screen.availHeight**
屏幕可用工作区宽度:window.screen.availWidth HTML精确定位:scrollLeft,scrollWidth,clientWidth,offsetWidth**
scrollHeight: 获取对象的滚动高度。**
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离**
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离**
scrollWidth:获取对象的滚动宽度**
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度**
offsetLeft:获取对象相对于版面或由 offsetParent 属性指定的父坐标的计算左侧位置**
offsetTop:获取对象相对于版面或由 offsetTop 属性指定的父坐标的计算顶端位置**
event.clientX 相对文档的水平座标**
event.clientY 相对文档的垂直座标**
event.offsetX 相对容器的水平坐标**
event.offsetY 相对容器的垂直坐标**
document.documentElement.scrollTop 垂直方向滚动的值**
event.clientX+document.documentElement.scrollTop 相对文档的水平座标+垂直方向滚动的量
IE,FireFox 差异如下:
IE6.0、FF1.06+:
clientWidth = width + padding
clientHeight = height + padding
offsetWidth = width + padding + border
offsetHeight = height + padding + border
IE5.0/5.5:**
clientWidth = width - border
clientHeight = height - border
offsetWidth = width
offsetHeight = height
(需要提一下:CSS中的margin属性,与clientWidth、offsetWidth、clientHeight、offsetHeight均无关)

JQuery+Js 获取浏览器高度和宽度的更多相关文章

  1. js获取浏览器高度和宽度值,尽量的考虑了多浏览器。

    js获取浏览器高度和宽度值,尽量的考虑了多浏览器. IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ...

  2. 【转】js 获取浏览器高度和宽度值(多浏览器

    原文地址:http://www.jb51.net/article/19844.htm js获取浏览器高度和宽度值,尽量的考虑了多浏览器. IE中: document.body.clientWidth ...

  3. js 获取浏览器高度和宽度值(多浏览器)(转)

    IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...

  4. 转:JS获取浏览器高度和宽度

    发现一篇好文章,汇总到自己的网站上. IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> ...

  5. js 获取浏览器高度和宽度值(多浏览器)

    IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...

  6. 不同浏览器JS获取浏览器高度和宽度

    摘自:http://blog.csdn.net/lai_gb/archive/2009/07/04/4320956.aspx IE中: document.body.clientWidth ==> ...

  7. JS获取浏览器高度和宽度

    IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...

  8. [转]js 获取浏览器高度和宽度值(多浏览器)(js获取宽度高度大全)

    IE中: document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.d ...

  9. JS获取浏览器高度 并赋值给类

    在给网站做轮播焦点图的时候,如果需要全屏的话,可以用下面的jQuery来获取浏览器高度,然后赋值给类. $(window).load(function () { var maxHeight = 0; ...

随机推荐

  1. COJ 0501 取数游戏(TPM)

    取数游戏(TPM) 难度级别:D: 运行时间限制:1000ms: 运行空间限制:51200KB: 代码长度限制:2000000B 试题描述 给你一个n*n的格子的棋盘,每个格子里面有一个非负数.从中取 ...

  2. C++ STL之map常用指令

    只记载本人在ACM中常用的函数. map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力. map内部为一颗 ...

  3. oracle查询和断开用户session

    select sid,serial#,username from v$session where username='user_name';alter system kill session 'sid ...

  4. 终于有人把O2O、C2C、B2B、B2C的区别讲透了

    一.O2O.C2C.B2B.B2C的区别在哪里? o2o 是 online to offline 分为四种运营模式 1.online to offline 是线上交易到线下消费体验 2.offline ...

  5. [原创]python MySQLdb在windows环境下的安装、出错问题以及解决办法

    版权声明:本文为博主原创文章,未经博主允许不得转载. 问题:windows下安装MySQLdb的方法 解析:python没有php那种集成环境,比如wamp那种集成软件直接把所有需要的东西全部一次性搭 ...

  6. jquery animate

    $(".logo").animate( { opacity: .25, //将不透明度逐渐变成.25 height: 0 //高度逐渐变成0 }, { duration: 1000 ...

  7. ipcs, ipcrm 命令

    ipcs命令 是linux/uinx上提供关于一些进程间通信方式的信息,包括共享内存,消息队列,信号 ipcs用法 ipcs -a  是默认的输出信息 打印出当前系统中所有的进程间通信方式的信息 ip ...

  8. server的散热和Linux中温度的检測

    当server被放在散热条件不好的条件下,这样会导致硬盘驱动过早损坏,而且server其它的组件也会非常快出现问题. 现代的server主板检測到CPU过热的时候,一般会限制CPU的频率,所以即使se ...

  9. [Javascript] Intro to Recursion

    Recursion is a technique well suited to certain types of tasks. In this first lesson we’ll look at s ...

  10. Apache http强制转为https页面访问(转)

    1 在httpd.conf文件里使下面模块生效 LoadModule rewrite_module modules/mod_rewrite.so   2 httpd.conf配置文件或者是在httpd ...