我使用下面的代码来检测页面底部的滚动,但在我的网页中它只能触发一次(在其他浏览器中它工作得很好):
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
alert('bottom');
get_page();
}
});该页面实际上位于:http://www.haorenao.com/life/
发布于 2011-12-21 10:21:08
你可以看到e.scrollTop == e.scrollHeight - e.height
如果"e“是窗口,则可以将clientHeight作为e.height
发布于 2011-12-21 10:24:49
试试这段代码。
window.onscroll = function() {
if ($(window).scrollTop() == $(document).height() - $(window).height()){
alert('bottom');
get_page();
}
};https://stackoverflow.com/questions/8584362
复制相似问题