IPhone and iPad end scroll

I make several jQuery cross-browser galleries with infinite scrolling, it works fine, but on the iPhone (suppose also on the iPad), instead of equal values, I have some imbalance values ​​that do not correspond

($(window).scrollTop() == ($(document).height() - $(window).height()) 

I just want to reach the end of the scroll on this, after which I can call the AJAX script, I also need to keep in mind that the values ​​change after two fingers, wipe the scale.

+5
source share
2 answers

You need to consider the 60px URL text box on the iPhone . Try the following:

($(window).scrollTop() + 60 == ($(document).height() - $(window).height()) 
+5
source
var wintop = $(window).scrollTop(), docheight = $(document).height(), winheight = $(window).height();
        var  scrolltrigger = 0.90;

        if  ((wintop/(docheight-winheight)) > scrolltrigger) {

            //Your AJAX CALL HERE
        }
    });
+3
source

All Articles