[js] 监听滚动条距离页面顶部的距离
console.log(document.body.scrollHeight);
var a = document.body.scrollHeight;
window.addEventListener("scroll", function(event) {
var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
console.log(scrollTop);
if(scrollTop > (a/2)){
console.log('xxxxxxxxxxxxxxxxxxx');
}
});