document.body与document.documentElement
document.body 获取的是body,document.documentElement获取的是html,在任何浏览器上都是如此
相关问题:
1.获取页面滚动条滚动距离
chrome,safari上用document.body.scrollTop,document.documentElement.scrollTop恒为0
firefox,IE上用document.documentElement.scrollTop,document.body,scrollTop恒为0
2.document.documentElement.offsetHeight在非IE浏览器上都是获取html的实际高度,而在IE上是可看见的部分区域的高度!
document.body与document.documentElement的更多相关文章
- document.body、document.documentElement和window获取视窗大小的区别
来源:http://www.ido321.com/906.html 在w3school关于window对象的介绍中,介绍了获取浏览器窗口大小的三种方法(浏览器的视口,不包括工具栏和滚动条). 对于In ...
- document.body 和 document.documentElement 的区别
document.body 和 document.documentElement 的区别 : www.cnblogs.com/scy251147/archive/2011/04/10/2011420. ...
- document.body和document.documentElement区别
1.document.documentElement表示文档节点树的根节点,即<html> document.body是body节点 2. 页面具有 DTD,或者说指定了 DOCTYPE ...
- document.body、document.documentElement和window获取视窗大小的差别
来源:http://www.ido321.com/906.html 在w3school关于window对象的介绍中,介绍了获取浏览器窗体大小的三种方法(浏览器的视口,不包含工具栏和滚动栏). 对于In ...
- document.documentElement和document.body 与document.compatMode的关系
首先我们看看document.compatMode(兼容模式): document.compatMode它有两种可能的返回值:BackCompat和CSS1Compat, document.compa ...
- (document).height()、$(document).scrollTop()
(document).height().$(document).scrollTop(),有需要的朋友可以参考下. jQuery(window).height()代表了当前可见区域的大小,而jQuery ...
- document.images、document.forms、doucument.links——>HTMLCollection
由于历史原因,HTMLDocument类定义了一些快捷属性来访问各种各样的节点.例如,images.forms.links等属性指向香味类似只读数组的<img>.<form>. ...
- javascript中document.appendChild和document.body.appendChild的问题
在IE7中 var conentDiv = document.createElement("div"); document .body .appendChild(conentDiv ...
- 各浏览器对使用 document.id 和 document.name 获取对象的支持存在差异
标准参考 无. 问题描述 各浏览器使用 document.id 和 document.name 方法获取对象引用的支持存在差异. 造成的影响 某些浏览器中通过 document.id 和 docume ...
- Make the “Check out” function available in the office document opened with Document ID link
I found a solution to make the “Check out” function available in the office document opened with Doc ...
随机推荐
- /tmp 和 /var/tmp 的区别
/tmp is meant as fast (possibly small) storage with a short time to live (TTL). Many systems clean / ...
- 关于ActionScript在Java调用上的一些原理
在公司遇到了ActionScript调用Java的需求,所以大概了解了一下: 一般基本是分成了三块,本身flash的项目,ActionScript的库,Java的库 通信方式一般有两种: 一.Acti ...
- BitSort
这个题为<编程珠玑>中提到的算法,解题思路和桶排序/基数排序一样,适用于大量没有重复的数据. 结题思路: 1.遍历整个数据文件,每提取一个数据,在BitMap中对应的位置赋1 2.遍历Bi ...
- ES6 相关资料
Configuring Babel 6 Setting up ES6
- Kettle jdbc连接hive出现问题
jdbc连接时报如下错误: Error connecting to database [k] : org.pentaho.di.core.exception.KettleDatabaseExcepti ...
- c# new关键字的三种用法
三种用法如下: 在 C# 中,new 关键字可用作运算符.修饰符或约束. 1)new 运算符:用于创建对象和调用构造函数. 2)new 修饰符:在用作修饰符时,new 关键字可以显式隐藏从基类继承的成 ...
- Python 跳出多重循环
Python 本身没有“break n” 和“goto” 的语法,这也造成了Python 难以跳出多层(特定层数)循环.下面是几个跳出多层(特定层数)循环的tip. 1.自定义异常 class g ...
- Ubuntu14.04下手动建立快捷方式
先在桌面创建一个文件:文件内容如下 [Desktop Entry]Encoding=UTF-8Name=eclipseComment=eclipse ideExec=/home/mars/eclips ...
- 笨方法学python--读文件
1 raw_input()的另外用法 prompt = '> ' likes = raw_input(prompt) 提示符> 可以不用每次输入,要修改,只修改一个地方. 2 读取文件 t ...
- 如何用脚本快速修改IP地址(Netsh)
如何用脚本快速修改IP地址(Netsh) 如果通过Windows的网络属性修改Ip/网关,真是太麻烦了.最近一个项目经常要切换ip,所以我写了两个脚本:c:\116.bat netsh interfa ...