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的更多相关文章

  1. document.body、document.documentElement和window获取视窗大小的区别

    来源:http://www.ido321.com/906.html 在w3school关于window对象的介绍中,介绍了获取浏览器窗口大小的三种方法(浏览器的视口,不包括工具栏和滚动条). 对于In ...

  2. document.body 和 document.documentElement 的区别

    document.body 和 document.documentElement 的区别 : www.cnblogs.com/scy251147/archive/2011/04/10/2011420. ...

  3. document.body和document.documentElement区别

    1.document.documentElement表示文档节点树的根节点,即<html> document.body是body节点 2. 页面具有 DTD,或者说指定了 DOCTYPE ...

  4. document.body、document.documentElement和window获取视窗大小的差别

    来源:http://www.ido321.com/906.html 在w3school关于window对象的介绍中,介绍了获取浏览器窗体大小的三种方法(浏览器的视口,不包含工具栏和滚动栏). 对于In ...

  5. document.documentElement和document.body 与document.compatMode的关系

    首先我们看看document.compatMode(兼容模式): document.compatMode它有两种可能的返回值:BackCompat和CSS1Compat, document.compa ...

  6. (document).height()、$(document).scrollTop()

    (document).height().$(document).scrollTop(),有需要的朋友可以参考下. jQuery(window).height()代表了当前可见区域的大小,而jQuery ...

  7. document.images、document.forms、doucument.links——>HTMLCollection

    由于历史原因,HTMLDocument类定义了一些快捷属性来访问各种各样的节点.例如,images.forms.links等属性指向香味类似只读数组的<img>.<form>. ...

  8. javascript中document.appendChild和document.body.appendChild的问题

    在IE7中 var conentDiv = document.createElement("div"); document .body .appendChild(conentDiv ...

  9. 各浏览器对使用 document.id 和 document.name 获取对象的支持存在差异

    标准参考 无. 问题描述 各浏览器使用 document.id 和 document.name 方法获取对象引用的支持存在差异. 造成的影响 某些浏览器中通过 document.id 和 docume ...

  10. 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 ...

随机推荐

  1. c socket(续)

    存在两种字节顺序:NBO与HBO 网络字节顺序NBO(Network Byte Order):按从高到低的顺序存储,在网络上使用统一的网络字节顺序,可以避免兼容性问题. 主机字节顺序(HBO,Host ...

  2. 删除putty的session 以及 putty的颜色设置值

    HKEY_CURRENT_USER\Software\SimonTatham\PuTTY 将sessions里面的内容清空即可 ==================================== ...

  3. HTML5 学习总结

    1,h5比原来的h4.0版本的页面头部更为简化, <!doctype html> <meta charset="utf-8"/>sublime中快速生成格式 ...

  4. java抽象类的特点

    抽象类 抽象类的特点: 1.抽象类的方法可以是抽象的,也可以是不抽象的. 2.抽象类的方法可以全是抽象的,也可以全是不抽象的. 3.有抽象方法的类必须是抽象类,或者是接口(但是接口的方法定义必须是pu ...

  5. crontab定时任务

    使用cron服务,用 service crond status 查看 cron服务状态,如果没有启动则 service crond start启动它, cron服务是一个定时执行的服务,可以通过cro ...

  6. android异步Http框架

    首先在GitHub上下载异步Http框架代码以及相关文档: 将jar包放入lib包中即可: 接下来分别实现get.post.文件上传功能实现: 代码实现如下: AsyncHttpClient clie ...

  7. Windows 路径问题

    Windows路径是我们经常使用的东西,它看似简单,实际上隐含许多细节,这些都是在平常的使用过程中注意不到的.下面让我们来看看各种各样的Windows路径.     提起路径,我们都会想到" ...

  8. zencart 后台目录产品黄色icon_yellow_on.gif 解决方案

    解决方法,导入时候发现 更新成功! - 型号: as NO.1209 就是重复model 文件位置:manager\includes\modules\category_product_listing. ...

  9. String与string的区别

    在C#中,string 是 System.String 的别名,所以基本上在使用时是没有差别的. 习惯上,我们把字符串当作对象时(有值的对象实体),我们用string.而我们把它当类时(需要字符串类中 ...

  10. git分支--branch

    分支创建: $ git branch testing 显示分支: $ git branch iss53 * master testing 如果需要查看每一个分支的最后一次提交 $ git branch ...