lundi 25 juillet 2016

Jquery checking if user scrolled to bottom works reversed

I have got this code in three different js files var sd=0;

$(window).scroll(function() {
               if($(window).scrollTop() + $(window).height() == $(document).height()) {
                sd++;
                          $.ajax({
                            url: '../connect.php',
                            type: 'GET',
                            cache: false,
                            contentType: false,
                            processData: false,
                            data:"SMu=true&&sd="+sd,                         
                            success: function(d)
                            {    
                                $(".upfile").append(d);
                                $(".ShowMoreUpl").remove();
                            }   
                        });
               }
            });

In one file it works quintessentially while in other it works when i scroll to the apex.What may be the reason that causes this problem?

Aucun commentaire:

Enregistrer un commentaire