So basically my problem is a seemingly simple one.
You can see it in action at http://furnace.howcode.com (please note that data is returned via Ajax, so if nothing
I know this question is already solved, but a concern when using jQuery scrollTOp()
function on element other than on $(window).scrollTop()
or $(document).scrollTop()
since some issue like
jQuery: detecting reaching bottom of scroll doesn't work, only detects the top
Explain why scrollTop() always returns 0 here
$(document).scrollTop() always returns 0
So you can use
$(window).scrollTop() - $('your_selector').offset().top
instead of
$('your_selector').scrollTOp()
to avoid the jQuery scrollTOp()
issue.
My suggestion is as follows:
$(window).scroll(function() {
var $more = $('#col2');
var top = $(window).scrollTop() - $more.offset().top;
if(top + $more.innerHeight() >= $more[0].scrollHeight) {
loadMore();
}
});