I have a scroll function that I want to fire when the user scrolls to the very bottom of the page. However it is doing the exact opposite; it is firing at the top of the page. I have used this before, and everything on the web says to do it this same way as well. The only thing I can think of is that it has something to do with using bootstrap. Any ideas? Here is an example: Click Here

 // Load More Results On Scroll
    var busy = false;
        if($(window).scrollTop() + $(window).height() == $(document).height() && !busy){
            // Currently Fetching Results
            busy = true;

            // Fetch The Rows
            setTimeout(function() {
                    url: "../assets/server/public/callbacks.php",
                    type: "POST",
                    dataType: "JSON",
                    data: {
                        filter: '',
                        old_id: $("#old-id").val(),
                        callback: 'selectPreviousTenPosts'
                    cache: false,
                    success: function(data){
                        busy = false;
            }, 500);

Edited by dschuett

3 Years
Discussion Span
Last Post by AleMonteiro

In the example you gave, they use this validation:

if($(window).scrollTop() + window.innerHeight >= $(document).height() - 50 && !busy){


View Source is very usefull =)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.