I am using the below to trigger an inifinite scroll and fire an Ajax request. This works fine on desktop and iPad browsers but not on iPhone. What am I missing?
//Ajax
var page = 1;
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() == $(document).height()) {
page++;
var data = {
page_num : page
};
$.ajax({
type : "POST",
url : "data.php",
data : data,
success : function(res) {
$(".thumbnails").append(res);
}
});
}
});
This solved it: