0

Following infinite scrolling script working nice on desktop and Android web browser, but not working on iPhone 4. What should I modify for make it work for iPhone and Android?

"#more" is div ID for mysql query output.

Here is part of script

var page = 1;
$(window).scroll(function () {
 $('#more').hide();
 $('#no-more').hide();

 if($(window).scrollTop() + $(window).height() > $(document).height() - 200) {
   $('#more').css("top","400");
   $('#more').show();
 }

 if($(window).scrollTop() + $(window).height() == $(document).height()) {

 $('#more').hide();
 $('#no-more').hide();

 page++;
Kon
  • 4,023
  • 4
  • 24
  • 38
paul y cho
  • 39
  • 1
  • 9

2 Answers2

0

Old Code : Old Code below work only pc browser.

if ((($(window).scrollTop()+document.body.clientHeight)==$(window).height()) && isload=='true'){

New Code : I just change == to >=. It work on Android (Chrome) and iOS too

if ((($(window).scrollTop()+document.body.clientHeight)>=$(window).height()) && isload=='true')
-2

try to replace this :

if($(window).scrollTop() + $(window).height() == $(document).height())

By this :

if($(window).scrollTop() + $(window).height() > $(document).height())