Posted in Javascript onApril 18, 2013
function reachBottom() { var scrollTop = 0; var clientHeight = 0; var scrollHeight = 0; if (document.documentElement && document.documentElement.scrollTop) { scrollTop = document.documentElement.scrollTop; } else if (document.body) { scrollTop = document.body.scrollTop; } if (document.body.clientHeight && document.documentElement.clientHeight) { clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight: document.documentElement.clientHeight; } else { clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight: document.documentElement.clientHeight; } scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); if (scrollTop + clientHeight == scrollHeight) { return true; } else { return false; } }
JS 各种网页尺寸判断实例方法
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@