css:
.ifcontainer2 {
background-color: #fff;
/* height: 100% !important; */
border: 1px solid #ececee;
box-shadow: 0px 1px 1px 0px rgba(56, 64, 79, 0.05);
border-radius: 4px;
overflow-y: auto;
}
js:
$(".ifcontainer2").height($("body").height());
window.onresize = function () {
$(".ifcontainer2").height($("body").height());
}
window.addEventListener('scroll', function () {
console.log(document.documentElement.scrollTop); //代表目前滚动条和最上方的距离多长
console.log(document.documentElement.scrollHeight); //代表整个滚动条多长
console.log(document.documentElement.clientHeight);
console.log(document.documentElement.scrollHeight - document.documentElement.scrollTop - document
.documentElement.clientHeight);
})