js文档高度位置相关值获取
var dd = document.body || document.documentElement;
var h1 = Math.max(dd.clientHeight,db.clientHeight);
var h2 = Math.max(dd.scrollHeight,db.scrollHeight);
var objH = Math.max(h1,h2);
===============测试总结==================
has w3c
chrome:document文档高度($(document).height())==document.body.clientHeight;
document.documentElement.scrollHeight==document.body.scrollHeight
可视高度($(window).height())==document.documentElement.clientHeight;
scrollTop==document.body.scrollTop
firefox:document文档高度==document.body.clientHeight;
document.documentElement.scrollHeight==document.body.scrollHeight
可视高度==document.documentElement.clientHeight;
scrollTop==document.documentElement.scrollTop;
ie:document文档高度==document.body.clientHeight;
document.documentElement.scrollHeight==document.body.scrollHeight
可视高度==document.documentElement.clientHeight;
scrollTop==document.documentElement.scrollTop;
no w3c
chrome:document文档高度($(document).height())!=document.body.clientHeight;
document文档高度==document.documentElement.clientHeight;
document.documentElement.scrollHeight==document.body.scrollHeight
可视高度($(window).height())==document.documentElement.clientHeight;等于文档高度
可视高度为document.body.clientHeight;
scrollTop==document.body.scrollTop
firefox:document文档高度($(document).height())!=document.body.clientHeight;
document文档高度==document.documentElement.clientHeight;
document.documentElement.scrollHeight==document.body.scrollHeight
可视高度($(window).height())==document.documentElement.clientHeight;等于文档高度
可视高度为document.body.clientHeight;
scrollTop==document.body.scrollTop
ie:document文档高度==document.body.scrollHeight;
可视高度==document.body.clientHeight;
document.documentElement.scrollHeight
document.documentElement.clientHeight==0
scrollTop==document.body.scrollTop
has w3c兼容
文档高(推荐scrollHeight,document.body.clientHeight || document.documentElement.clientHeight;)
--------------------------------------兼容ie firefox chrome--------------------------------
文档高document.documentElement.scrollHeight||document.body.scrollHeight;(注意)
可视高document.documentElement.clientHeight || document.body.clientHeight;
scrollTop==document.documentElement.scrollTop||document.body.scrollTop;
-------------------------------------------------------------------------------------------
no w3c兼容
文档高document.documentElement.clientHeight || document.body.scrollHeight;
可视高document.body.clientHeight
scrollTop==document.documentElement.scrollTop||document.body.scrollTop;