ff chrome和ie下全局动态定位的异同及全局高度的取法

  DTD已声明

  IE

  document.documentElement.scrollHeight 浏览器所有内容高度 ,document.body.scrollHeight 浏览器所有内容高度

  document.documentElement.scrollTop 浏览器滚动部分高度,document.body.scrollTop 始终为0

  document.documentElement.clientHeight 浏览器可视部分高度,document.body.clientHeight 浏览器所有内容高度

  FF

  document.documentElement.scrollHeight 浏览器所有内容高度 ,document.body.scrollHeight 浏览器所有内容高度

  document.documentElement.scrollTop 浏览器滚动部分高度,document.body.scrollTop 始终为0

  document.documentElement.clientHeight 浏览器可视部分高度,document.body.clientHeight 浏览器所有内容高度

  Chrome

  document.documentElement.scrollHeight 浏览器所有内容高度, document.body.scrollHeight 浏览器所有内容高度

  document.documentElement.scrollTop 始终为0,document.body.scrollTop 浏览器滚动部分高度

  document.documentElement.clientHeight 浏览器可视部分高度,document.body.clientHeight 浏览器所有内容高度

  DTD未声明

  IE

  document.documentElement.scrollHeight 浏览器可视部分高度,document.body.scrollHeight 浏览器所有内容高度

  document.documentElement.scrollTop 始终为0,document.body.scrollTop 浏览器滚动部分高度

  document.documentElement.clientHeight 始终为0,document.body.clientHeight 浏览器可视部分高度

  FF

  document.documentElement.scrollHeight 浏览器可视部分高度, document.body.scrollHeight 浏览器所有内容高度

  document.documentElement.scrollTop 始终为0,document.body.scrollTop 浏览器滚动部分高度

  document.documentElement.clientHeight 浏览器所有内容高度,document.body.clientHeight 浏览器可视部分高度

  Chrome

  document.documentElement.scrollHeight 浏览器可视部分高度,document.body.scrollHeight 浏览器所有内容高度

  document.documentElement.scrollTop 始终为0,document.body.scrollTop 浏览器滚动部分高度

  document.documentElement.clientHeight 浏览器所有内容高度,document.body.clientHeight 浏览器可视部分高度

  浏览器所有内容高度即浏览器整个框架的高度,包括滚动条卷去部分+可视部分+底部隐藏部分的高度总和

  浏览器滚动部分高度即滚动条卷去部分高度即可视顶端距离整个对象顶端的高度。

  DTD声明,指的是浏览器页面载入时候的声明:<!DOCTYPE html public ""....>

  声明文档类型html