D
D
deleted-mezhevikin2011-11-19 21:09:34
JavaScript
deleted-mezhevikin, 2011-11-19 21:09:34

Scroll tracking in Mobile Safari?

How to track with jquery in mobile safari what is scrolling down to load new content?

This is not working on iphone:

$(window).scroll(function(){<br>
<br>
  if  ($(window).scrollTop() == $(document).height() - $(window).height()){<br>
<br>
     alert('bottom');<br>
<br>
  }<br>
<br>
})<br>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sdevalex, 2011-11-20
@sdevalex

1. In such cases, don't use "==", otherwise nothing will work (">") because of the 1px difference.
2. You need to load content a little earlier by ~ 50-100px

if($(window).scrollTop() > $(document).height() - $(window).height() - 50) ...

There is no place to check now, I can’t say for sure ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question