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. Spark开发指南

    原文链接http://www.sxt.cn/info-2730-u-756.html 目录 Spark开发指南 简介 接入Spark Java 初始化Spark Java 弹性分布式数据集 并行集合 ...

  2. javascript获取css中的样式值

    <body> <input type="button" id="btn" value="启动"/> <img ...

  3. ajax不进success,

    $.ajax({ url:"/order/pay_order_wx?order_id="+order_id, type:'GET', data:"{}", da ...

  4. opkg

    opkg是个安装器,小乔,功能全. root@hbg:/# opkg files opkgPackage opkg (9c97d5ecd795709c8584e972bfdf3aee3a5b846d- ...

  5. Qt4.8.x Linux WebKit依赖库安装

    yum install "pkgconfig(gstreamer-app-0.10)"

  6. JSP中的EL语言

    1,EL(Expression Language)是从JavaScript得到启发的一种表达式语言, 2,EL表达式包含文字,操作符,变量,函数调用: 3,EL 存取变量的语法格式:${ userna ...

  7. 转:Delphi中destroy, free, freeAndNil, release用法和区别

    http://blog.sina.com.cn/s/blog_44fa172f0101cur1.html 1)destroy:虚方法 释放内存,在Tobject中声明为virtual,通常是在其子类中 ...

  8. [ An Ac a Day ^_^ ] hdu 1003 dp

    超时还有可能是数组开小了…… #include<stdio.h> #include<iostream> #include<algorithm> #include&l ...

  9. onbeforeunload与a标签在IE中的冲突bug(转载)

    onbeforeunload与a标签在IE中的冲突bug   onbeforeunload 是window的一个事件,目前Firefox,IE都支持,主要用来提示用户是否真的要离开该页面,通常在一些比 ...

  10. 使用observable数组(Working with observable arrays)

    observable数组(observable arrays) 如果你要探测和响应一个对象的变化,你应该用observables.如果你需要探测和响应一个集合对象的变化,你应该用observableA ...