//滚动条在Y轴上的滚动距离
function getScrollTop(){
return document.body.scrollTop;
}
//文档的总高度
function getScrollHeight(){
return document.body.clientHeight;
}
//浏览器视口的高度
function getWindowHeight(){
var windowHeight = 0;
if(document.compatMode == "CSS1Compat")
{
windowHeight = document.documentElement.clientHeight;
}
else
{
windowHeight = document.body.clientHeight;
}
return windowHeight;
}
//滑动监听
window.onscroll = function(){
//滑到底部时footer定于最下方,假定