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 ...
随机推荐
- String对象的Replace()
<!DOCTYPE html> <html> <head> </head> <body> <script type="tex ...
- 【Unity】Unity中C#与Android中Java的互相调用遇到的一些问题
1.有关调用的一些问题: (1).在C#中直接调用java中的代码,无返回值: 在java中: public static void setAge(Context context , int leve ...
- ajax通过设置Access-Control-Allow-Origin来实现跨域访问
[在被请求的Response header中加入] // 指定允许其他域名访问(*代表所有域名)header('Access-Control-Allow-Origin:*');// 响应类型heade ...
- iOS开发的一些奇巧淫技(转载)
iOS开发的一些奇巧淫技 http://www.cocoachina.com/ios/20141229/10783.html iOS开发的一些奇巧淫技2 http://www.cocoachina.c ...
- 移动端touch事件获取clientX, clientY
目有个交互需要实现手指滑动的交互,pc端使用mousedown,mousemove,mouseup监听实现. 但在ios设备上mousemove是不好监听的,同类的方法是touchstart,touc ...
- ajax的理解和运用
AJAX : Asynchronous JavaScript and XML(异步的 JavaScript 和 XML). AJAX 是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术. 譬 ...
- finally语句包含return的情况
结论:1.不管有木有出现异常,finally块中代码都会执行:2.当try和catch中有return时,finally仍然会执行:3.finally是在return后面的表达式运算后执行的(此时并没 ...
- photoshop cs6 mac版
首选项 -> 界面,调整工作区背景色 放大:command + "+" 放大镜:z 矩形选框工具(M):用来抠图,做造型.shift正方形选取 填充前景色:alt + del ...
- 不安装oracle客户端,如何运行sqlplus
1.软件下载 http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html 下载如下三个包: oracle-instantc ...
- kindle网络爬虫续集
简单介绍: 这次我们要爬的网页是:Kindle商店中的今日特价书,其中每周/每月特价书同理,就不再重复了选择这个网页的原因有两个:一是实用,很多人都会经常去看看Kindle特价书有没有自己喜欢的:二是 ...