window.onscroll = function (){ var marginBot = 0; if (document.compatMode === "CSS1Compat"){ marginBot = document.documentElement.scrollHeight - (document.documentElement.scrollTop+document.body.scrollTop)- document.documentElement.clientHeight; } else { marginBot = document.body.scrollHeight - document.body.scrollTop- document.body.clientHeight; } if(marginBot<=0) { //do something } }
时间: 2024-10-03 03:46:53