var scrollTop = $(window).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(window).height();
if ((scrollTop + windowHeight) == scrollHeight) {
console.log('scroll to bottom')
}
窗口宽高 https://stackoverflow.com/a/8876069
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
上滚高度 https://stackoverflow.com/a/14384091, pageYOffset是scrollY的别名
var top = window.pageYOffset || document.documentElement.scrollTop,
left = window.pageXOffset || document.documentElement.scrollLeft;
文档高度 https://stackoverflow.com/a/5484623
var height = document.body.clientHeight;
var width = document.body.clientWidth;