I need to detect if user scrolled to the bottom of the page so I can make some action.
But I did something wrong and when I scroll to the bottom nothing happens but when I scroll to the top it fires the action :(.
And should opposite :)
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height() && !($('#imgLoad').is(':visible'))) {
alert('you hit bottom');
loadMore();
}
});